From 817dd7ccbb166b27c93706dffc5c0c0d59fd87f8 Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Sun, 30 Oct 2016 19:05:14 +0100 Subject: style: Fix PEP8 blank lines issues in Python files Done with `autopep8 --select=E3,W3`, fixes: - E301 - Add missing blank line. - E302 - Add missing 2 blank lines. - E303 - Remove extra blank lines. - E304 - Remove blank line following function decorator. - E309 - Add missing blank line. - W391 - Remove trailing blank lines. --- tools/SCsub | 4 ---- tools/editor/SCsub | 8 -------- tools/editor/icons/SCsub | 4 +--- tools/scripts/addheader.py | 2 -- tools/scripts/file-hex-array.py | 3 +++ tools/scripts/make_bmfhdr.py | 3 --- tools/scripts/make_glwrapper.py | 5 ----- tools/scripts/makeargs.py | 6 ------ tools/scripts/svgs_2_pngs.py | 1 - 9 files changed, 4 insertions(+), 32 deletions(-) (limited to 'tools') diff --git a/tools/SCsub b/tools/SCsub index 87ed836ae..f11aa34ee 100644 --- a/tools/SCsub +++ b/tools/SCsub @@ -10,12 +10,10 @@ Export('env') def make_translations_header(target, source, env): - dst = target[0].srcnode().abspath g = open(dst, "wb") - """" """ @@ -65,12 +63,10 @@ def make_translations_header(target, source, env): def make_fonts_header(target, source, env): - dst = target[0].srcnode().abspath g = open(dst, "wb") - """" """ diff --git a/tools/editor/SCsub b/tools/editor/SCsub index 0dbb7d3f2..625103eae 100644 --- a/tools/editor/SCsub +++ b/tools/editor/SCsub @@ -14,7 +14,6 @@ def make_doc_header(target, source, env): import zlib buf = zlib.compress(buf) - g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef _DOC_DATA_RAW_H\n") g.write("#define _DOC_DATA_RAW_H\n") @@ -27,7 +26,6 @@ def make_doc_header(target, source, env): g.write("#endif") - def make_certs_header(target, source, env): src = source[0].srcnode().abspath @@ -39,7 +37,6 @@ def make_certs_header(target, source, env): import zlib buf = zlib.compress(buf) - g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef _CERTS_RAW_H\n") g.write("#define _CERTS_RAW_H\n") @@ -52,11 +49,6 @@ def make_certs_header(target, source, env): g.write("#endif") - - - - - if (env["tools"] == "yes"): reg_exporters_inc = '#include "register_exporters.h"\n' diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub index ac942b20e..f27350a18 100644 --- a/tools/editor/icons/SCsub +++ b/tools/editor/icons/SCsub @@ -2,6 +2,7 @@ Import('env') + def make_editor_icons_action(target, source, env): import os @@ -58,9 +59,6 @@ def make_editor_icons_action(target, source, env): except: s.write("static const unsigned char* " + var_str + "=NULL;\n\n\n"); - - - s.write("static Ref make_icon(const uint8_t* p_png,const uint8_t* p_hidpi_png) {\n") s.write("\tRef texture( memnew( ImageTexture ) );\n") s.write("\tbool use_hidpi_image=(editor_get_scale()>1.0&&p_hidpi_png);\n") diff --git a/tools/scripts/addheader.py b/tools/scripts/addheader.py index 573d5182f..7838e16ae 100644 --- a/tools/scripts/addheader.py +++ b/tools/scripts/addheader.py @@ -56,7 +56,6 @@ while (fname != ""): else: text = header.replace("$filename", fsingle) - while (l != ""): if ((l.find("//") != 0 and l.find("/*") != 0 and l.strip() != "") or bc): text += l @@ -69,4 +68,3 @@ while (fname != ""): fr.close() # print(text) fname = f.readline() - diff --git a/tools/scripts/file-hex-array.py b/tools/scripts/file-hex-array.py index 8b7c3edd7..da95c9505 100755 --- a/tools/scripts/file-hex-array.py +++ b/tools/scripts/file-hex-array.py @@ -2,6 +2,7 @@ import binascii import os.path import sys + def tof(filepath): with open(filepath, 'r') as f: content = f.read() @@ -15,6 +16,7 @@ def tof(filepath): print(os.path.basename(filepath) + ".file created.") exit(0) + def toa(filepath): with open(filepath, 'rb') as f: content = f.read() @@ -28,6 +30,7 @@ def toa(filepath): print(os.path.basename(filepath) + ".array created.") exit(0) + def usage(): print("========================================================\n\ #\n\ diff --git a/tools/scripts/make_bmfhdr.py b/tools/scripts/make_bmfhdr.py index e6aa43f6b..1d3c40f9c 100644 --- a/tools/scripts/make_bmfhdr.py +++ b/tools/scripts/make_bmfhdr.py @@ -33,7 +33,6 @@ while(l != ""): s = x.split("=") d[s[0]] = s[1] - if (t == "common"): font_height = d["lineHeight"] font_ascent = d["base"] @@ -49,8 +48,6 @@ while(l != ""): font_chars.append(d["xadvance"]) font_cc += 1 - - l = f.readline() diff --git a/tools/scripts/make_glwrapper.py b/tools/scripts/make_glwrapper.py index 9f26f8430..bae0eeead 100644 --- a/tools/scripts/make_glwrapper.py +++ b/tools/scripts/make_glwrapper.py @@ -87,7 +87,6 @@ for x in (range(len(sys.argv) - 1)): print(funcdata) - # print(types) # print(constants) # print(functions) @@ -177,7 +176,3 @@ for x in functions: f.write("\n\n") f.write("}\n") f.write("\n\n") - - - - diff --git a/tools/scripts/makeargs.py b/tools/scripts/makeargs.py index a52812eaf..2cd47ae08 100644 --- a/tools/scripts/makeargs.py +++ b/tools/scripts/makeargs.py @@ -64,7 +64,6 @@ text = """ """ - for i in range(1, 8): tp = "" @@ -81,8 +80,3 @@ for i in range(1, 8): t = text.replace("$argtp", tp).replace("$argp", p).replace("$argt", t).replace("$num", str(i)) print(t) - - - - - diff --git a/tools/scripts/svgs_2_pngs.py b/tools/scripts/svgs_2_pngs.py index b55fd97d0..b24324dcd 100644 --- a/tools/scripts/svgs_2_pngs.py +++ b/tools/scripts/svgs_2_pngs.py @@ -73,7 +73,6 @@ def export_icons(): svg_to_png(source_path, theme_dir_base + theme_out_icon_name, 90) - def export_theme(): svgs_path = theme_dir_source file_names = [f for f in listdir(svgs_path) if isfile(join(svgs_path, f))] -- cgit v1.2.3-70-g09d2