summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2015-12-10 17:01:37 (GMT)
committerDirk Baechle <dl9obn@darc.de>2015-12-10 17:01:37 (GMT)
commite7de9d22c9503cf29e5d8b5e7813f060d59a00e5 (patch)
treed88708df964dc576ad2a85eedd9ef08cd29a0240 /src/engine/SCons/Node
parent78fb1b6ef0e42954feb668efb84de59173221374 (diff)
downloadSCons-e7de9d22c9503cf29e5d8b5e7813f060d59a00e5.zip
SCons-e7de9d22c9503cf29e5d8b5e7813f060d59a00e5.tar.gz
SCons-e7de9d22c9503cf29e5d8b5e7813f060d59a00e5.tar.bz2
removed several pre-2.7 methods and imports, including some basic refactorings
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r--src/engine/SCons/Node/FS.py53
-rw-r--r--src/engine/SCons/Node/FSTests.py10
-rw-r--r--src/engine/SCons/Node/NodeTests.py2
-rw-r--r--src/engine/SCons/Node/__init__.py7
4 files changed, 3 insertions, 69 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 4e78852..4a4942b 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -186,7 +186,7 @@ needs_normpath_check = re.compile(
# We need to renormalize the path if it contains a '.'
# directory, but NOT if it is a single '.' '/' characters. We
# do not want to match a single '.' because this case is checked
- # for explicitely since this is common enough case.
+ # for explicitly since this is common enough case.
#
# Note that we check for all the following cases:
#
@@ -1165,15 +1165,6 @@ class LocalFS(object):
return ''
-#class RemoteFS:
-# # Skeleton for the obvious methods we might need from the
-# # abstraction layer for a remote filesystem.
-# def upload(self, local_src, remote_dst):
-# pass
-# def download(self, remote_src, local_dst):
-# pass
-
-
class FS(LocalFS):
def __init__(self, path = None):
@@ -2234,7 +2225,6 @@ class Dir(Base):
# the overall list will also be filtered later,
# after we exit this loop.
if pattern[0] != '.':
- #disk_names = [ d for d in disk_names if d[0] != '.' ]
disk_names = [x for x in disk_names if x[0] != '.']
disk_names = fnmatch.filter(disk_names, pattern)
dirEntry = dir.Entry
@@ -2627,13 +2617,6 @@ class File(Base):
the directory of this file."""
return self.dir.File(name)
- #def generate_build_dict(self):
- # """Return an appropriate dictionary of values for building
- # this File."""
- # return {'Dir' : self.Dir,
- # 'File' : self.File,
- # 'RDirs' : self.RDirs}
-
def _morph(self):
"""Turn a file system node into a File object."""
self.scanner_paths = {}
@@ -2907,9 +2890,7 @@ class File(Base):
pass
if scanner:
- # result = [n.disambiguate() for n in scanner(self, env, path)]
- result = scanner(self, env, path)
- result = [N.disambiguate() for N in result]
+ result = [n.disambiguate() for n in scanner(self, env, path)]
else:
result = []
@@ -3519,36 +3500,6 @@ class FileFinder(object):
filedir, filename = os.path.split(filename)
if filedir:
- # More compact code that we can't use until we drop
- # support for Python 1.5.2:
- #
- #def filedir_lookup(p, fd=filedir):
- # """
- # A helper function that looks up a directory for a file
- # we're trying to find. This only creates the Dir Node
- # if it exists on-disk, since if the directory doesn't
- # exist we know we won't find any files in it... :-)
- # """
- # dir, name = os.path.split(fd)
- # if dir:
- # p = filedir_lookup(p, dir)
- # if not p:
- # return None
- # norm_name = _my_normcase(name)
- # try:
- # node = p.entries[norm_name]
- # except KeyError:
- # return p.dir_on_disk(name)
- # if isinstance(node, Dir):
- # return node
- # if isinstance(node, Entry):
- # node.must_be_same(Dir)
- # return node
- # if isinstance(node, Dir) or isinstance(node, Entry):
- # return node
- # return None
- #paths = [_f for _f in map(filedir_lookup, paths) if _f]
-
self.default_filedir = filedir
paths = [_f for _f in map(self.filedir_lookup, paths) if _f]
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 0c1e71f..fc27859 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -751,16 +751,6 @@ class FileNodeInfoTestCase(_tempdirTestCase):
size = st[stat.ST_SIZE]
assert ni.size != size, (ni.size, size)
- #fff.clear()
- #ni.update(fff)
-
- #st = os.stat('fff')
-
- #mtime = st[stat.ST_MTIME]
- #assert ni.timestamp == mtime, (ni.timestamp, mtime)
- #size = st[stat.ST_SIZE]
- #assert ni.size == size, (ni.size, size)
-
class FileBuildInfoTestCase(_tempdirTestCase):
def test___init__(self):
"""Test File.BuildInfo initialization"""
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index 1478419..3802f8c 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -358,8 +358,6 @@ class NodeTestCase(unittest.TestCase):
ggg.path = "ggg"
fff.sources = ["hhh", "iii"]
ggg.sources = ["hhh", "iii"]
- # [Charles C. 1/7/2002] Uhhh, why are there no asserts here?
- # [SK, 15 May 2003] I dunno, let's add some...
built_it = None
fff.build()
assert built_it
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index 5aa9600..40ee8f0 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -577,7 +577,7 @@ class Node(object):
self.always_build = None
self.includes = None
self.attributes = self.Attrs() # Generic place to stick information about the Node.
- self.side_effect = 0 # true iff this node is a side effect
+ self.side_effect = 0 # true if this node is a side effect
self.side_effects = [] # the side effects of building this target
self.linked = 0 # is this node linked to the variant directory?
self.changed_since_last_build = 0
@@ -1281,11 +1281,6 @@ class Node(object):
def _add_child(self, collection, set, child):
"""Adds 'child' to 'collection', first checking 'set' to see if it's
already present."""
- #if type(child) is not type([]):
- # child = [child]
- #for c in child:
- # if not isinstance(c, Node):
- # raise TypeError, c
added = None
for c in child:
if c not in set: