Skip to content

Commit 03bcbb1

Browse files
shancock884peterbarker
authored andcommitted
autotest: Flake8 clean all logger metadata scripts
1 parent 10c3c3e commit 03bcbb1

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

Tools/autotest/logger_metadata/emit_html.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
'''
2+
AP_FLAKE8_CLEAN
3+
'''
14
import emitter
25

6+
37
class HTMLEmitter(emitter.Emitter):
48
def preface(self):
59
return """<!-- Dynamically generated list of Logger Messages
@@ -18,6 +22,7 @@ def preface(self):
1822
[toc exclude="Onboard Message Log Messages"]
1923
2024
"""
25+
2126
def postface(self):
2227
return ""
2328

@@ -42,7 +47,7 @@ def emit(self, doccos, enumerations):
4247
fdesc = docco.fields[f]["description"]
4348
else:
4449
fdesc = ""
45-
if "units" in docco.fields[f] and docco.fields[f]["units"]!="":
50+
if "units" in docco.fields[f] and docco.fields[f]["units"] != "":
4651
ftypeunits = docco.fields[f]["units"]
4752
elif "fmt" in docco.fields[f] and "char" in docco.fields[f]["fmt"]:
4853
ftypeunits = docco.fields[f]["fmt"]

Tools/autotest/logger_metadata/emit_md.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
'''
2+
AP_FLAKE8_CLEAN
3+
'''
4+
15
import os
26
import time
37
import emitter
48

9+
510
class MDEmitter(emitter.Emitter):
611
def preface(self):
712
if os.getenv('BRDOC') is not None:
@@ -50,6 +55,7 @@ def preface(self):
5055
[toc exclude="Onboard Message Log Messages"]
5156
5257
"""
58+
5359
def postface(self):
5460
return ""
5561

@@ -73,7 +79,7 @@ def emit(self, doccos, enumerations=None):
7379
fdesc = docco.fields[f]["description"]
7480
else:
7581
fdesc = ""
76-
if "units" in docco.fields[f] and docco.fields[f]["units"]!="":
82+
if "units" in docco.fields[f] and docco.fields[f]["units"] != "":
7783
ftypeunits = docco.fields[f]["units"]
7884
elif "fmt" in docco.fields[f] and "char" in docco.fields[f]["fmt"]:
7985
ftypeunits = docco.fields[f]["fmt"]

Tools/autotest/logger_metadata/emit_rst.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
'''
2+
AP_FLAKE8_CLEAN
3+
'''
14
import emitter
25

6+
37
class RSTEmitter(emitter.Emitter):
48
def preface(self):
59
return """.. Dynamically generated list of Logger Messages
@@ -15,6 +19,7 @@ def preface(self):
1519
This is a list of log messages which may be present in logs produced and stored onboard ArduPilot vehicles.
1620
1721
"""
22+
1823
def postface(self):
1924
return ""
2025

@@ -60,7 +65,7 @@ def emit(self, doccos, enumerations):
6065
enumeration = enumerations[enum_name]
6166
bitmaskrows = []
6267
for enumentry in enumeration.entries:
63-
# print("enumentry: %s" % str(enumentry))
68+
# print("enumentry: %s" % str(enumentry))
6469
comment = enumentry.comment
6570
if comment is None:
6671
comment = ""
@@ -84,7 +89,6 @@ def stop(self):
8489
print(self.postface(), file=self.fh)
8590
self.fh.close()
8691

87-
8892
# tablify swiped from rstemit.py
8993

9094
def tablify_row(self, rowheading, row, widths, height):
@@ -205,4 +209,3 @@ def tablify(self, rows, headings=None, rowheadings=None):
205209
ret += bar + "\n"
206210

207211
return ret
208-

Tools/autotest/logger_metadata/emit_xml.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
'''
2+
AP_FLAKE8_CLEAN
3+
'''
14
from lxml import etree
25
import emitter
36

7+
48
class XMLEmitter(emitter.Emitter):
59
def preface(self):
610
return """<?xml version="1.0" encoding="utf-8"?>
@@ -56,7 +60,7 @@ def emit(self, doccos, enumerations):
5660
for entry in enum.entries:
5761
xml_enum_entry = etree.SubElement(xml_enum, xmlentrytag, name=entry.name)
5862
xml_enum_entry_value = etree.SubElement(xml_enum_entry, 'value')
59-
xml_enum_entry_value.text = str(entry.value)
63+
xml_enum_entry_value.text = str(entry.value)
6064
if entry.comment is not None:
6165
xml_enum_entry_comment = etree.SubElement(xml_enum_entry, 'description')
6266
xml_enum_entry_comment.text = entry.comment

Tools/autotest/logger_metadata/emitter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
'''
2+
AP_FLAKE8_CLEAN
3+
'''
4+
5+
16
class Emitter(object):
27
pass
3-

0 commit comments

Comments
 (0)