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.
This commit is contained in:
Rémi Verschelde 2016-10-30 19:05:14 +01:00
parent d4c17700aa
commit 817dd7ccbb
53 changed files with 115 additions and 193 deletions

View file

@ -16,6 +16,7 @@ tab = 0
old_classes = {}
def write_string(_f, text, newline=True):
for t in range(tab):
_f.write("\t")
@ -23,6 +24,7 @@ def write_string(_f, text, newline=True):
if (newline):
_f.write("\n")
def escape(ret):
ret = ret.replace("&", "&");
ret = ret.replace("<", "&gt;");
@ -36,6 +38,7 @@ def inc_tab():
global tab
tab += 1
def dec_tab():
global tab
tab -= 1
@ -43,12 +46,14 @@ def dec_tab():
write_string(f, '<?xml version="1.0" encoding="UTF-8" ?>')
write_string(f, '<doc version="' + new_doc.attrib["version"] + '">')
def get_tag(node, name):
tag = ""
if (name in node.attrib):
tag = ' ' + name + '="' + escape(node.attrib[name]) + '" '
return tag
def find_method_descr(old_class, name):
methods = old_class.find("methods")
@ -61,6 +66,7 @@ def find_method_descr(old_class, name):
return None
def find_signal_descr(old_class, name):
signals = old_class.find("signals")
@ -73,6 +79,7 @@ def find_signal_descr(old_class, name):
return None
def find_constant_descr(old_class, name):
if (old_class == None):
@ -85,6 +92,7 @@ def find_constant_descr(old_class, name):
return m.text
return None
def write_class(c):
class_name = c.attrib["name"]
print("Parsing Class: " + class_name)
@ -93,7 +101,6 @@ def write_class(c):
else:
old_class = None
category = get_tag(c, "category")
inherits = get_tag(c, "inherits")
write_string(f, '<class name="' + class_name + '" ' + category + inherits + '>')
@ -106,7 +113,6 @@ def write_class(c):
if (old_brief_descr != None):
write_string(f, escape(old_brief_descr.text.strip()))
write_string(f, "</brief_description>")
write_string(f, "<description>")
@ -207,5 +213,3 @@ for c in list(old_doc):
for c in list(new_doc):
write_class(c)
write_string(f, '</doc>\n')