mirror of
https://github.com/CorsixTH/CorsixTH.git
synced 2025-07-23 04:13:01 +02:00
scripts: use str.format() instead of concatenating in some places
This commit is contained in:
@@ -158,7 +158,7 @@ class Sprite:
|
|||||||
y = y + 1
|
y = y + 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
im.save("sprite_" + str(self.number) + ".png")
|
im.save("sprite_{}.png".format(self.number))
|
||||||
|
|
||||||
|
|
||||||
inf = Infile("x.out")
|
inf = Infile("x.out")
|
||||||
|
@@ -21,7 +21,7 @@ def is_BOM_encoded_file(path):
|
|||||||
|
|
||||||
|
|
||||||
if len(sys.argv) > 2:
|
if len(sys.argv) > 2:
|
||||||
sys.exit('Usage: ' + sys.argv[0] + ' [root]')
|
sys.exit('Usage: {} [root]'.format(sys.argv[0]))
|
||||||
|
|
||||||
top = os.getcwd()
|
top = os.getcwd()
|
||||||
if len(sys.argv) == 2:
|
if len(sys.argv) == 2:
|
||||||
|
@@ -24,7 +24,7 @@ for root, _, files in os.walk(script_dir):
|
|||||||
problem_found = True
|
problem_found = True
|
||||||
print("Invalid/Improper Class Declarations Found:")
|
print("Invalid/Improper Class Declarations Found:")
|
||||||
path = print_root_regex.search(root).group(0)
|
path = print_root_regex.search(root).group(0)
|
||||||
print("*" + path + "\\" + script + ":" + found_class)
|
print("*{}:{}".format(os.path.join(path, script), found_class))
|
||||||
|
|
||||||
if problem_found:
|
if problem_found:
|
||||||
print("\nReason: The class declaration(s) didn't begin as follows:")
|
print("\nReason: The class declaration(s) didn't begin as follows:")
|
||||||
|
@@ -28,7 +28,7 @@ def has_trailing_whitespaces(path):
|
|||||||
|
|
||||||
|
|
||||||
if len(sys.argv) > 2:
|
if len(sys.argv) > 2:
|
||||||
sys.exit('Usage: ' + sys.argv[0] + ' [root]')
|
sys.exit('Usage: {} [root]'.format(sys.argv[0]))
|
||||||
|
|
||||||
top = os.getcwd()
|
top = os.getcwd()
|
||||||
if len(sys.argv) == 2:
|
if len(sys.argv) == 2:
|
||||||
|
Reference in New Issue
Block a user