diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2016-10-30 18:57:40 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2016-11-01 00:35:16 +0100 |
commit | d4c17700aa2f36f69978beda04e42ff2749de270 (patch) | |
tree | 466f774d5fff723d6496e7259529c366fe01855a /tools/editor/icons/SCsub | |
parent | 97c8508f5e4f57b1048830d44e76e1f4517fd449 (diff) |
style: Fix PEP8 whitespace issues in Python files
Done with `autopep8 --select=E2,W2`, fixes:
- E201 - Remove extraneous whitespace.
- E202 - Remove extraneous whitespace.
- E203 - Remove extraneous whitespace.
- E211 - Remove extraneous whitespace.
- E221 - Fix extraneous whitespace around keywords.
- E222 - Fix extraneous whitespace around keywords.
- E223 - Fix extraneous whitespace around keywords.
- E224 - Remove extraneous whitespace around operator.
- E225 - Fix missing whitespace around operator.
- E226 - Fix missing whitespace around operator.
- E227 - Fix missing whitespace around operator.
- E228 - Fix missing whitespace around operator.
- E231 - Add missing whitespace.
- E231 - Fix various deprecated code (via lib2to3).
- E241 - Fix extraneous whitespace around keywords.
- E242 - Remove extraneous whitespace around operator.
- E251 - Remove whitespace around parameter '=' sign.
- E261 - Fix spacing after comment hash.
- E262 - Fix spacing after comment hash.
- E265 - Format block comments.
- E271 - Fix extraneous whitespace around keywords.
- E272 - Fix extraneous whitespace around keywords.
- E273 - Fix extraneous whitespace around keywords.
- E274 - Fix extraneous whitespace around keywords.
- W291 - Remove trailing whitespace.
- W293 - Remove trailing whitespace.
Diffstat (limited to 'tools/editor/icons/SCsub')
-rw-r--r-- | tools/editor/icons/SCsub | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub index 4806a89df2..ac942b20e3 100644 --- a/tools/editor/icons/SCsub +++ b/tools/editor/icons/SCsub @@ -16,47 +16,47 @@ def make_editor_icons_action(target, source, env): s.write("#include \"editor_scale.h\"\n\n") s.write("#include \"scene/resources/theme.h\"\n\n") - hidpi_list=[] + hidpi_list = [] for x in pixmaps: - x=str(x) - var_str=os.path.basename(x)[:-4]+"_png"; - #print(var_str) + x = str(x) + 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); - while(len(b)==1): + b = pngf.read(1); + while(len(b) == 1): s.write(hex(ord(b))) - b=pngf.read(1); - if (len(b)==1): + b = pngf.read(1); + if (len(b) == 1): s.write(",") s.write("\n};\n\n"); pngf.close(); - var_str=os.path.basename(x)[:-4]+"_hidpi_png"; + var_str = os.path.basename(x)[:-4] + "_hidpi_png"; try: - pngf = open(os.path.dirname(x)+"/2x/"+os.path.basename(x), "rb") + 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); - while(len(b)==1): + b = pngf.read(1); + while(len(b) == 1): s.write(hex(ord(b))) - b=pngf.read(1); - if (len(b)==1): + b = pngf.read(1); + if (len(b) == 1): s.write(",") 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"); @@ -75,24 +75,24 @@ 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"); + 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"); s.write("\n\n}\n\n"); - f = open(dst,"wb") + f = open(dst, "wb") f.write(s.getvalue()) f.close() s.close() make_editor_icons_builder = Builder(action=make_editor_icons_action, - suffix = '.cpp', - src_suffix = '.png') -env['BUILDERS']['MakeEditorIconsBuilder']=make_editor_icons_builder -env.Alias('editor_icons',[env.MakeEditorIconsBuilder('#tools/editor/editor_icons.cpp',Glob("*.png"))]) + suffix='.cpp', + src_suffix='.png') +env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder +env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#tools/editor/editor_icons.cpp', Glob("*.png"))]) env.tool_sources.append("#tools/editor/editor_icons.cpp") Export('env') |