summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-12-28 07:17:31 (GMT)
committerSteven Knight <knight@baldmt.com>2002-12-28 07:17:31 (GMT)
commitee46aa600c5aa266f0904c686e656ab545375820 (patch)
tree733a58e6a58301011d17feb2054dba6c9b981aa4 /src/engine/SCons/Node
parent474383d6f14d1594ad394c22afd837d1522175e9 (diff)
downloadSCons-ee46aa600c5aa266f0904c686e656ab545375820.zip
SCons-ee46aa600c5aa266f0904c686e656ab545375820.tar.gz
SCons-ee46aa600c5aa266f0904c686e656ab545375820.tar.bz2
Change the Action object execute() methods to __call__() methods.
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r--src/engine/SCons/Node/FS.py16
-rw-r--r--src/engine/SCons/Node/FSTests.py16
-rw-r--r--src/engine/SCons/Node/NodeTests.py2
-rw-r--r--src/engine/SCons/Node/__init__.py2
4 files changed, 18 insertions, 18 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 626a22a..dee50df 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -83,7 +83,7 @@ def LinkFunc(target, source, env):
os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
return 0
-LinkAction = SCons.Action.Action(LinkFunc, None)
+Link = SCons.Action.Action(LinkFunc, None)
def LocalString(target, source):
return 'Local copy of %s from %s' % (target[0], source[0])
@@ -94,13 +94,13 @@ def UnlinkFunc(target, source, env):
os.unlink(target[0].path)
return 0
-UnlinkAction = SCons.Action.Action(UnlinkFunc, None)
+Unlink = SCons.Action.Action(UnlinkFunc, None)
def MkdirFunc(target, source, env):
os.mkdir(target[0].path)
return 0
-MkdirAction = SCons.Action.Action(MkdirFunc, None)
+Mkdir = SCons.Action.Action(MkdirFunc, None)
#
class ParentOfRoot:
@@ -882,7 +882,7 @@ class File(Entry):
for dirnode in listDirs:
dirnode._exists = 1
try:
- MkdirAction.execute(dirnode, None, None)
+ Mkdir(dirnode, None, None)
except OSError:
pass
@@ -905,7 +905,7 @@ class File(Entry):
if self.exists():
if self.builder and not self.precious:
- UnlinkAction.execute(self, None, None)
+ Unlink(self, None, None)
if hasattr(self, '_exists'):
delattr(self, '_exists')
else:
@@ -929,10 +929,10 @@ class File(Entry):
if src.exists() and src.abspath != self.abspath:
self._createDir()
try:
- UnlinkAction.execute(self, None, None)
+ Unlink(self, None, None)
except OSError:
pass
- LinkAction.execute(self, src, None)
+ Link(self, src, None)
self.created = 1
# Set our exists cache accordingly
@@ -952,7 +952,7 @@ class File(Entry):
# ...and it's even up-to-date...
if self._local:
# ...and they'd like a local copy.
- LocalCopy.execute(self, r, None)
+ LocalCopy(self, r, None)
self.set_bsig(bsig)
self.store_bsig()
return 1
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 98857bf..a624d97 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -50,7 +50,7 @@ class Builder:
def get_actions(self):
class Action:
- def execute(self, targets, sources, env):
+ def __call__(self, targets, sources, env):
global built_it
built_it = 1
return 0
@@ -255,13 +255,13 @@ class BuildDirTestCase(unittest.TestCase):
assert f8.rfile().path == os.path.normpath(test.workpath('rep1/build/var2/test2.out')),\
f8.rfile().path
- # Test to see if LinkAction() works...
+ # Test to see if Link() works...
test.subdir('src','build')
test.write('src/foo', 'src/foo\n')
os.chmod(test.workpath('src/foo'), stat.S_IRUSR)
- SCons.Node.FS.LinkAction.execute(fs.File(test.workpath('build/foo')),
- fs.File(test.workpath('src/foo')),
- None)
+ SCons.Node.FS.Link(fs.File(test.workpath('build/foo')),
+ fs.File(test.workpath('src/foo')),
+ None)
os.chmod(test.workpath('src/foo'), stat.S_IRUSR | stat.S_IWRITE)
st=os.stat(test.workpath('build/foo'))
assert (stat.S_IMODE(st[stat.ST_MODE]) & stat.S_IWRITE), \
@@ -356,9 +356,9 @@ class BuildDirTestCase(unittest.TestCase):
test.write('src/foo', 'src/foo\n')
os.chmod(test.workpath('src/foo'), stat.S_IRUSR)
- SCons.Node.FS.LinkAction.execute(fs.File(test.workpath('build/foo')),
- fs.File(test.workpath('src/foo')),
- None)
+ SCons.Node.FS.Link(fs.File(test.workpath('build/foo')),
+ fs.File(test.workpath('src/foo')),
+ None)
test.unlink( "src/foo" )
test.unlink( "build/foo" )
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index abfbe1c..a2b95a5 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -39,7 +39,7 @@ built_source = None
cycle_detected = None
class MyAction:
- def execute(self, target, source, env):
+ def __call__(self, target, source, env):
global built_it, built_target, built_source, built_args
built_it = 1
built_target = target
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index ca6e8eb..e5aae5c 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -122,7 +122,7 @@ class Node:
targets = self.builder.targets(self)
env = self.generate_build_env()
for action in action_list:
- stat = action.execute(targets, self.sources, env)
+ stat = action(targets, self.sources, env)
if stat:
raise SCons.Errors.BuildError(node = self,
errstr = "Error %d" % stat)