From ad02fe3b8b3bc5f8ae17e6059ab8456ddf459d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Thu, 5 Mar 2015 16:24:05 +0100 Subject: some Python script cleanups based on PyCharm inspection (nw) --- src/build/makelist.py | 28 ++++++++++++++-------------- src/build/verinfo.py | 4 ++-- src/regtests/jedutil/jedtest.py | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/build/makelist.py b/src/build/makelist.py index 190f0aad9e3..a25012515ec 100644 --- a/src/build/makelist.py +++ b/src/build/makelist.py @@ -26,22 +26,22 @@ def parse_file(srcfile): srcptr+=1 continue if c==' ': - continue; + continue if in_comment==1 and c=='*' and line[srcptr]=='/' : srcptr+=1 - in_comment = 0; + in_comment = 0 continue - if (in_comment): + if in_comment: continue if c=='/' and line[srcptr]=='*' : srcptr+=1 - in_comment = 1; + in_comment = 1 continue if c=='/' and line[srcptr]=='/' : break drivname += c drivname = drivname.strip() - if (len(drivname)>0): + if len(drivname)>0: if drivname[0]=='#': sys.stderr.write("Importing drivers from '%s'\n" % drivname[1:]) parse_file(drivname[1:]) @@ -54,16 +54,16 @@ def parse_file(srcfile): return 0 -if (len(sys.argv) < 2) : +if len(sys.argv) < 2: print('Usage:') print(' makelist ') sys.exit(0) -if (parse_file(sys.argv[1])) : +if parse_file(sys.argv[1]) : sys.exit(1) # output a count -if (len(drivlist)==0) : +if len(drivlist)==0 : sys.stderr.write("No drivers found\n") sys.exit(1) @@ -73,21 +73,21 @@ sys.stderr.write("%d drivers found\n" % len(drivlist)) drivlist.append("___empty") # start with a header -print('#include "emu.h"\n'); -print('#include "drivenum.h"\n'); +print('#include "emu.h"\n') +print('#include "drivenum.h"\n') #output the list of externs first for drv in sorted(drivlist): - print("GAME_EXTERN(%s);" % drv) + print("GAME_EXTERN(%s);" % drv) print("") # then output the array print("const game_driver * const driver_list::s_drivers_sorted[%d] =" % len(drivlist)) print("{") for drv in sorted(drivlist): - print("\t&GAME_NAME(%s)," % drv) -print("};"); -print(""); + print("\t&GAME_NAME(%s)," % drv) +print("};") +print("") # also output a global count print("int driver_list::s_driver_count = %d;\n" % len(drivlist)) diff --git a/src/build/verinfo.py b/src/build/verinfo.py index dfd4cc2f889..d4e54785d62 100644 --- a/src/build/verinfo.py +++ b/src/build/verinfo.py @@ -23,13 +23,13 @@ def parse_args(): elif flags and (sys.argv[i] == '-p'): format = 'plist' elif flags and (sys.argv[i] == '-b'): - i += 1; + i += 1 if (i >= len(sys.argv)) or (sys.argv[i] not in ('mame', 'mess', 'ume')): usage() else: target = sys.argv[i] elif flags and (sys.argv[i] == '-o'): - i += 1; + i += 1 if (i >= len(sys.argv)) or (output is not None): usage() else: diff --git a/src/regtests/jedutil/jedtest.py b/src/regtests/jedutil/jedtest.py index 291456af193..bbb63ddee4f 100644 --- a/src/regtests/jedutil/jedtest.py +++ b/src/regtests/jedutil/jedtest.py @@ -58,8 +58,8 @@ def runViewJedTests(tests, jedUtilApp): for test in tests: command = [jedUtilApp, "-view", test.jedFile, test.name] if VERBOSE: - print "Viewing the JED file: %s" % (test.jedFile) - print "Command: %s" % ((" ").join(command)) + print "Viewing the JED file: %s" % test.jedFile + print "Command: %s" % " ".join(command) process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout,stderr) = process.communicate() @@ -84,7 +84,7 @@ def main(): else: jedUtilApp = os.path.normpath(os.path.join(currentDirectory, "..", "..", "..", "jedutil")) - if (VERBOSE): + if VERBOSE: print "JED Path: %s" % jedsPath print "Baseline Path: %s" % baselinePath print "Output Path: %s" % outputPath @@ -109,7 +109,7 @@ def main(): # Setup the output paths - if (VERBOSE): + if VERBOSE: print "Cleaning the output directory" print if os.path.exists(outputPath): -- cgit v1.2.3