diff options
author | Steven Knight <knight@baldmt.com> | 2009-11-22 18:26:25 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2009-11-22 18:26:25 (GMT) |
commit | d15249a560354c394c387151f26de769060c01a0 (patch) | |
tree | fe6d6bee3ab1bfd0a366bab55418e6ef260c6b69 | |
parent | 8e7d11938e780283fd48424c822a62b2d925e3dc (diff) | |
download | SCons-d15249a560354c394c387151f26de769060c01a0.zip SCons-d15249a560354c394c387151f26de769060c01a0.tar.gz SCons-d15249a560354c394c387151f26de769060c01a0.tar.bz2 |
Python 1.5 fixes in the TimeSCons class.
-rw-r--r-- | QMTest/TestSCons.py | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index 1fed39a..cf8e357 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -957,7 +957,9 @@ class TimeSCons(TestSCons): """ if not kw.has_key('verbose'): kw['verbose'] = True - TestSCons.__init__(self, *args, **kw) + # TODO(1.5) + #TestSCons.__init__(self, *args, **kw) + apply(TestSCons.__init__, (self,)+args, kw) # TODO(sgk): better way to get the script dir than sys.argv[0] test_dir = os.path.dirname(sys.argv[0]) @@ -984,9 +986,13 @@ class TimeSCons(TestSCons): The elapsed time to execute each build is printed after it has finished. """ - self.help(*args, **kw) - self.full(*args, **kw) - self.null(*args, **kw) + # TODO(1.5) + #self.help(*args, **kw) + #self.full(*args, **kw) + #self.null(*args, **kw) + apply(self.help, args, kw) + apply(self.full, args, kw) + apply(self.null, args, kw) def help(self, *args, **kw): """ @@ -997,7 +1003,9 @@ class TimeSCons(TestSCons): "real work" is done. """ kw['options'] = kw.get('options', '') + ' --help' - self.run_build(*args, **kw) + # TODO(1.5) + #self.run_build(*args, **kw) + apply(self.run_build, args, kw) sys.stdout.write(self.stdout()) print "RESULT", self.elapsed_time() @@ -1005,7 +1013,9 @@ class TimeSCons(TestSCons): """ Runs a full build of SCons. """ - self.run_build(*args, **kw) + # TODO(1.5) + #self.run_build(*args, **kw) + apply(self.run_build, args, kw) sys.stdout.write(self.stdout()) print "RESULT", self.elapsed_time() @@ -1015,7 +1025,11 @@ class TimeSCons(TestSCons): """ # TODO(sgk): allow the caller to specify the target (argument) # that must be up-to-date. - self.up_to_date(arguments='.', **kw) + # TODO(1.5) + #self.up_to_date(arguments='.', **kw) + kw = kw.copy() + kw['arguments'] = '.' + apply(self.up_to_date, (), kw) sys.stdout.write(self.stdout()) print "RESULT", self.elapsed_time() @@ -1037,7 +1051,9 @@ class TimeSCons(TestSCons): kw['options'] = kw.get('options', '') + ' --debug=memory --debug=time' self.startTime = time.time() try: - result = TestSCons.run(self, *args, **kw) + # TODO(1.5) + #result = TestSCons.run(self, *args, **kw) + result = apply(TestSCons.run, (self,)+args, kw) finally: self.endTime = time.time() return result @@ -1054,8 +1070,12 @@ class TimeSCons(TestSCons): for root, dirs, files in os.walk(source_dir): if '.svn' in dirs: dirs.remove('.svn') - dirs = [ d for d in dirs if not d.startswith('TimeSCons-') ] - files = [ f for f in files if not f.startswith('TimeSCons-') ] + # TODO(1.5) + #dirs = [ d for d in dirs if not d.startswith('TimeSCons-') ] + #files = [ f for f in files if not f.startswith('TimeSCons-') ] + timescons_entries = lambda s: s.startswith('TimeSCons-') + dirs = filter(timescons_entries, dirs) + files = filter(timescons_entries, files) for dirname in dirs: source = os.path.join(root, dirname) destination = source.replace(source_dir, dest_dir) |