diff options
author | Mats Wichmann <mats@linux.com> | 2019-12-22 15:44:29 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-12-23 16:52:35 (GMT) |
commit | a5359e3f10a6bcdb5d9667c95c40ddd890b551e8 (patch) | |
tree | dd587ca78a6d4542c6bd968e4590b6671464d39d /bin | |
parent | 5a864bae1380155997f4041d607e4abcf74652ca (diff) | |
download | SCons-a5359e3f10a6bcdb5d9667c95c40ddd890b551e8.zip SCons-a5359e3f10a6bcdb5d9667c95c40ddd890b551e8.tar.gz SCons-a5359e3f10a6bcdb5d9667c95c40ddd890b551e8.tar.bz2 |
syntax fixups suggested by PyCharm
Drop unneeded parens.
Drop trailing semicolons.
Triple double-quote docstrings.
Regexes drop unneeded escapes.
Spaces around parens, braces: remove/add.
Some one-tuples get their missing closing comma.
A couple of sets use set init syntax {foo} instead of set([iter]) now.
And a fiddle in Node to reduce lookup time on md5 signature functions
(came about because of a line-too-long issue, initially)
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/SConsExamples.py | 2 | ||||
-rw-r--r-- | bin/scons-diff.py | 10 | ||||
-rwxr-xr-x | bin/scons_dev_master.py | 4 | ||||
-rwxr-xr-x | bin/svn-bisect.py | 2 | ||||
-rw-r--r-- | bin/update-release-info.py | 26 |
5 files changed, 15 insertions, 29 deletions
diff --git a/bin/SConsExamples.py b/bin/SConsExamples.py index dbb8715..50fbb4e 100644 --- a/bin/SConsExamples.py +++ b/bin/SConsExamples.py @@ -830,7 +830,7 @@ def create_scons_output(e): # regardless of reported addresses or Python version. # Massage addresses in object repr strings to a constant. - address_re = re.compile(r' at 0x[0-9a-fA-F]*\>') + address_re = re.compile(r' at 0x[0-9a-fA-F]*>') # Massage file names in stack traces (sometimes reported as absolute # paths) to a consistent relative path. diff --git a/bin/scons-diff.py b/bin/scons-diff.py index 687e7fa..0bed74b 100644 --- a/bin/scons-diff.py +++ b/bin/scons-diff.py @@ -30,7 +30,7 @@ Options: opts, args = getopt.getopt(sys.argv[1:], 'c:dhnqrsu:', - ['context=', 'help', 'recursive', 'unified=']) + ['context=', 'help', 'recursive', 'unified=']) diff_type = None edit_type = None @@ -53,17 +53,17 @@ for o, a in opts: diff_options.append(o) elif o in ('-h', '--help'): print(Usage) - sys.exit(0) - elif o in ('-n'): + sys.exit(0) + elif o in ('-n',): diff_options.append(o) edit_type = o - elif o in ('-q'): + elif o in ('-q',): diff_type = o diff_line = lambda l, r: None elif o in ('-r', '--recursive'): recursive = True diff_options.append(o) - elif o in ('-s'): + elif o in ('-s',): report_same = True try: diff --git a/bin/scons_dev_master.py b/bin/scons_dev_master.py index cdbd68e..d4c8e90 100755 --- a/bin/scons_dev_master.py +++ b/bin/scons_dev_master.py @@ -152,11 +152,11 @@ Usage: scons_dev_master.py [-hnqy] [--password PASSWORD] [--username USER] sys.exit(0) elif o in ('-n', '--no-exec'): CommandRunner.execute = CommandRunner.do_not_execute - elif o in ('--password'): + elif o in '--password': password = a elif o in ('-q', '--quiet'): CommandRunner.display = CommandRunner.do_not_display - elif o in ('--username'): + elif o in '--username': username = a elif o in ('-y', '--yes', '--assume-yes'): yesflag = o diff --git a/bin/svn-bisect.py b/bin/svn-bisect.py index dbf8dd9..575b15e 100755 --- a/bin/svn-bisect.py +++ b/bin/svn-bisect.py @@ -33,7 +33,7 @@ def error(s): # update to the specified version and run test def testfail(revision): - "Return true if test fails" + """Return true if test fails""" print("Updating to revision", revision) if subprocess.call(["svn","up","-qr",str(revision)]) != 0: m = "SVN did not update properly to revision %d" diff --git a/bin/update-release-info.py b/bin/update-release-info.py index fe5bbcf..fa7a5f8 100644 --- a/bin/update-release-info.py +++ b/bin/update-release-info.py @@ -146,13 +146,9 @@ except KeyError: if DEBUG: print('copyright years', copyright_years) class UpdateFile(object): - """ - XXX - """ + """ XXX """ def __init__(self, file, orig = None): - ''' - ''' if orig is None: orig = file try: with open(orig, 'r') as f: @@ -171,15 +167,11 @@ class UpdateFile(object): self.orig = '' def sub(self, pattern, replacement, count = 1): - ''' - XXX - ''' + """ XXX """ self.content = re.sub(pattern, replacement, self.content, count) def replace_assign(self, name, replacement, count = 1): - ''' - XXX - ''' + """ XXX """ self.sub('\n' + name + ' = .*', '\n' + name + ' = ' + replacement) # Determine the pattern to match a version @@ -189,9 +181,7 @@ class UpdateFile(object): match_rel = re.compile(match_pat) def replace_version(self, replacement = version_string, count = 1): - ''' - XXX - ''' + """ XXX """ self.content = self.match_rel.sub(replacement, self.content, count) # Determine the release date and the pattern to match a date @@ -213,15 +203,11 @@ class UpdateFile(object): match_date = re.compile(match_date) def replace_date(self, replacement = new_date, count = 1): - ''' - XXX - ''' + """ XXX """ self.content = self.match_date.sub(replacement, self.content, count) def __del__(self): - ''' - XXX - ''' + """ XXX """ if self.file is not None and self.content != self.orig: print('Updating ' + self.file + '...') with open(self.file, 'w') as f: |