diff options
author | William Deegan <bill@baddogconsulting.com> | 2018-06-27 20:15:29 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2018-11-12 16:46:00 (GMT) |
commit | 5c6fa923c7d18f5cdf8656ab79e5266541e9097f (patch) | |
tree | 8c42a73ff520793b3e8f85e0da48f14d78621933 /src/engine/SCons | |
parent | f5da82812631222e0c5a23c51c9b4cf25b5952d7 (diff) | |
download | SCons-5c6fa923c7d18f5cdf8656ab79e5266541e9097f.zip SCons-5c6fa923c7d18f5cdf8656ab79e5266541e9097f.tar.gz SCons-5c6fa923c7d18f5cdf8656ab79e5266541e9097f.tar.bz2 |
Clear up some comments and convert comment to docstring where it makes sense
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index f0576ca..8eefc5d 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -1065,21 +1065,22 @@ _classEntry = Entry class LocalFS(object): - - # This class implements an abstraction layer for operations involving - # a local file system. Essentially, this wraps any function in - # the os, os.path or shutil modules that we use to actually go do - # anything with or to the local file system. - # - # Note that there's a very good chance we'll refactor this part of - # the architecture in some way as we really implement the interface(s) - # for remote file system Nodes. For example, the right architecture - # might be to have this be a subclass instead of a base class. - # Nevertheless, we're using this as a first step in that direction. - # - # We're not using chdir() yet because the calling subclass method - # needs to use os.chdir() directly to avoid recursion. Will we - # really need this one? + """ + This class implements an abstraction layer for operations involving + a local file system. Essentially, this wraps any function in + the os, os.path or shutil modules that we use to actually go do + anything with or to the local file system. + + Note that there's a very good chance we'll refactor this part of + the architecture in some way as we really implement the interface(s) + for remote file system Nodes. For example, the right architecture + might be to have this be a subclass instead of a base class. + Nevertheless, we're using this as a first step in that direction. + + We're not using chdir() yet because the calling subclass method + needs to use os.chdir() directly to avoid recursion. Will we + really need this one? + """ #def chdir(self, path): # return os.chdir(path) def chmod(self, path, mode): @@ -3258,7 +3259,7 @@ class File(Base): NOTE: If the timestamp hasn't changed this will skip md5'ing the file and just copy the prev_ni provided. If the prev_ni - is wrong. It will propogate it. + is wrong. It will propagate it. See: https://github.com/SCons/scons/issues/2980 Args: @@ -3271,6 +3272,7 @@ class File(Base): """ if not self.changed_timestamp_match(target, prev_ni): try: + # NOTE: We're modifying the current node's csig in a query. self.get_ninfo().csig = prev_ni.csig except AttributeError: pass @@ -3284,6 +3286,12 @@ class File(Base): return 1 def changed_timestamp_match(self, target, prev_ni): + """ + Return True if the timestamps don't match or if there is no previous timestamp + :param target: + :param prev_ni: Information about the node from the previous build + :return: + """ try: return self.get_timestamp() != prev_ni.timestamp except AttributeError: |