summaryrefslogtreecommitdiff
path: root/tools/editor/icons
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2016-11-01 00:24:30 +0100
committerRémi Verschelde <rverschelde@gmail.com>2016-11-01 00:35:16 +0100
commitf34151ff0f91e8f0df8eaf829334b2205eb7da3c (patch)
tree2d074bb474b4b093c849ad2f6317dcc4ae5784f5 /tools/editor/icons
parent817dd7ccbb166b27c93706dffc5c0c0d59fd87f8 (diff)
style: Various other PEP8 fixes in Python files
Done with `autopep8 --select=E7`, fixes: - E701 - Put colon-separated compound statement on separate lines. - E702 - Put semicolon-separated compound statement on separate lines. - E703 - Put semicolon-separated compound statement on separate lines. - E711 - Fix comparison with None. - E712 - Fix (trivial case of) comparison with boolean. - E713 - Fix (trivial case of) non-membership check. - E721 - Fix various deprecated code (via lib2to3).
Diffstat (limited to 'tools/editor/icons')
-rw-r--r--tools/editor/icons/SCsub36
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub
index f27350a184..af6ebd67fd 100644
--- a/tools/editor/icons/SCsub
+++ b/tools/editor/icons/SCsub
@@ -22,42 +22,42 @@ def make_editor_icons_action(target, source, env):
for x in pixmaps:
x = str(x)
- var_str = os.path.basename(x)[:-4] + "_png";
+ var_str = os.path.basename(x)[:-4] + "_png"
# print(var_str)
- s.write("static const unsigned char " + var_str + "[]={\n");
+ s.write("static const unsigned char " + var_str + "[]={\n")
- pngf = open(x, "rb");
+ pngf = open(x, "rb")
- b = pngf.read(1);
+ b = pngf.read(1)
while(len(b) == 1):
s.write(hex(ord(b)))
- b = pngf.read(1);
+ b = pngf.read(1)
if (len(b) == 1):
s.write(",")
- s.write("\n};\n\n");
+ s.write("\n};\n\n")
- pngf.close();
- var_str = os.path.basename(x)[:-4] + "_hidpi_png";
+ pngf.close()
+ var_str = os.path.basename(x)[:-4] + "_hidpi_png"
try:
pngf = open(os.path.dirname(x) + "/2x/" + os.path.basename(x), "rb")
- s.write("static const unsigned char " + var_str + "[]={\n");
+ s.write("static const unsigned char " + var_str + "[]={\n")
- b = pngf.read(1);
+ b = pngf.read(1)
while(len(b) == 1):
s.write(hex(ord(b)))
- b = pngf.read(1);
+ b = pngf.read(1)
if (len(b) == 1):
s.write(",")
- s.write("\n};\n\n\n");
+ s.write("\n};\n\n\n")
hidpi_list.append(x)
except:
- s.write("static const unsigned char* " + var_str + "=NULL;\n\n\n");
+ s.write("static const unsigned char* " + var_str + "=NULL;\n\n\n")
s.write("static Ref<ImageTexture> make_icon(const uint8_t* p_png,const uint8_t* p_hidpi_png) {\n")
s.write("\tRef<ImageTexture> texture( memnew( ImageTexture ) );\n")
@@ -74,12 +74,12 @@ def make_editor_icons_action(target, source, env):
for x in pixmaps:
x = os.path.basename(str(x))
- type = x[5:-4].title().replace("_", "");
- var_str = x[:-4] + "_png";
- var_str_hidpi = x[:-4] + "_hidpi_png";
- s.write("\tp_theme->set_icon(\"" + type + "\",\"EditorIcons\",make_icon(" + var_str + "," + var_str_hidpi + "));\n");
+ type = x[5:-4].title().replace("_", "")
+ var_str = x[:-4] + "_png"
+ var_str_hidpi = x[:-4] + "_hidpi_png"
+ s.write("\tp_theme->set_icon(\"" + type + "\",\"EditorIcons\",make_icon(" + var_str + "," + var_str_hidpi + "));\n")
- s.write("\n\n}\n\n");
+ s.write("\n\n}\n\n")
f = open(dst, "wb")
f.write(s.getvalue())