clean-up: fix PEP8 E301 expected 1 blank line, found 0
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 16 Aug 2017 12:57:52 +0300
changeset 1751 c28db6f7616b
parent 1750 acf02488f37f
child 1752 d14ff9d7eb76
clean-up: fix PEP8 E301 expected 1 blank line, found 0
BeremizIDE.py
PLCControler.py
PLCGenerator.py
ProjectController.py
canfestival/canfestival.py
plcopen/plcopen.py
py_ext/PythonFileCTNMixin.py
runtime/WampClient.py
svgui/pyjs/jsonrpc/jsonrpc.py
targets/Linux/__init__.py
targets/Win32/__init__.py
targets/Xenomai/__init__.py
--- a/BeremizIDE.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/BeremizIDE.py	Wed Aug 16 12:57:52 2017 +0300
@@ -597,6 +597,7 @@
     # Twisted reactor needs to be stopped only before quit,
     # since it cannot be restarted
     ToDoBeforeQuit = []
+
     def AddToDoBeforeQuit(self, Thing):
         self.ToDoBeforeQuit.append(Thing)
 
--- a/PLCControler.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/PLCControler.py	Wed Aug 16 12:57:52 2017 +0300
@@ -155,9 +155,11 @@
 class _VariableInfos(object):
     __slots__ = ["Name", "Class", "Option", "Location", "InitialValue",
                  "Edit", "Documentation", "Type", "Tree", "Number"]
+
     def __init__(self, *args):
         for attr, value in zip(self.__slots__, args):
             setattr(self, attr, value if value is not None else "")
+
     def copy(self):
         return _VariableInfos(*[getattr(self, attr) for attr in self.__slots__])
 
@@ -226,9 +228,11 @@
 
 class _VariablesTreeItemInfos(object):
     __slots__ = ["name", "var_class", "type", "edit", "debug", "variables"]
+
     def __init__(self, *args):
         for attr, value in zip(self.__slots__, args):
             setattr(self, attr, value if value is not None else "")
+
     def copy(self):
         return _VariableTreeItem(*[getattr(self, attr) for attr in self.__slots__])
 
@@ -372,9 +376,11 @@
 
 class _ActionInfos(object):
     __slots__ = ["qualifier", "type", "value", "duration", "indicator"]
+
     def __init__(self, *args):
         for attr, value in zip(self.__slots__, args):
             setattr(self, attr, value if value is not None else "")
+
     def copy(self):
         return _ActionInfos(*[getattr(self, attr) for attr in self.__slots__])
 
--- a/PLCGenerator.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/PLCGenerator.py	Wed Aug 16 12:57:52 2017 +0300
@@ -695,14 +695,15 @@
                     self.Interface.append((varTypeNames[varlist_type], option, True, located))
 
     LITERAL_TYPES = {
-        "T": "TIME",
-        "D": "DATE",
+        "T":   "TIME",
+        "D":   "DATE",
         "TOD": "TIME_OF_DAY",
-        "DT": "DATE_AND_TIME",
-        "2": None,
-        "8": None,
-        "16": None,
+        "DT":  "DATE_AND_TIME",
+        "2":    None,
+        "8":    None,
+        "16":   None,
     }
+
     def ComputeConnectionTypes(self, pou):
         body = pou.getbody()
         if isinstance(body, ListType):
--- a/ProjectController.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/ProjectController.py	Wed Aug 16 12:57:52 2017 +0300
@@ -1180,18 +1180,22 @@
                 self.AppFrame.ShowError(infos, start, end)
 
     _IECCodeView = None
+
     def _showIECcode(self):
         self._OpenView("IEC code")
 
     _IECRawCodeView = None
+
     def _editIECrawcode(self):
         self._OpenView("IEC raw code")
 
     _ProjectFilesView = None
+
     def _OpenProjectFiles(self):
         self._OpenView("Project Files")
 
     _FileEditors = {}
+
     def _OpenFileEditor(self, filepath):
         self._OpenView(filepath)
 
--- a/canfestival/canfestival.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/canfestival/canfestival.py	Wed Aug 16 12:57:52 2017 +0300
@@ -365,6 +365,7 @@
         }
 
     _GeneratedMasterView = None
+
     def _ShowGeneratedMaster(self):
         self._OpenView("Generated master")
 
@@ -482,6 +483,7 @@
 
     CTNChildrenTypes = [("CanOpenNode",  _NodeListCTN, "CanOpen Master"),
                         ("CanOpenSlave", _SlaveCTN,    "CanOpen Slave")]
+
     def GetParamsAttributes(self, path=None):
         infos = ConfigTreeNode.GetParamsAttributes(self, path=path)
         for element in infos:
--- a/plcopen/plcopen.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/plcopen/plcopen.py	Wed Aug 16 12:57:52 2017 +0300
@@ -435,6 +435,7 @@
     datatypes_xpath = PLCOpen_XPath("ppx:types/ppx:dataTypes/ppx:dataType")
     filtered_datatypes_xpath = PLCOpen_XPath(
         "ppx:types/ppx:dataTypes/ppx:dataType[@name!=$exclude]")
+
     def getdataTypes(self, exclude=None):
         if exclude is not None:
             return filtered_datatypes_xpath(self, exclude=exclude)
@@ -483,12 +484,14 @@
 
     configurations_xpath = PLCOpen_XPath(
         "ppx:instances/ppx:configurations/ppx:configuration")
+
     def getconfigurations(self):
         return configurations_xpath(self)
     setattr(cls, "getconfigurations", getconfigurations)
 
     configuration_xpath = PLCOpen_XPath(
         "ppx:instances/ppx:configurations/ppx:configuration[@name=$name]")
+
     def getconfiguration(self, name):
         configurations = configuration_xpath(self, name=name)
         if len(configurations) == 1:
@@ -513,6 +516,7 @@
 
     resources_xpath = PLCOpen_XPath(
         "ppx:instances/ppx:configurations/ppx:configuration[@name=$configname]/ppx:resource[@name=$name]")
+
     def getconfigurationResource(self, config_name, name):
         resources = resources_xpath(self, configname=config_name, name=name)
         if len(resources) == 1:
@@ -578,6 +582,7 @@
 
     enumerated_values_xpath = PLCOpen_XPath(
         "ppx:types/ppx:dataTypes/ppx:dataType/ppx:baseType/ppx:enum/ppx:values/ppx:value")
+
     def GetEnumeratedDataTypeValues(self):
         return [value.getname() for value in enumerated_values_xpath(self)]
     setattr(cls, "GetEnumeratedDataTypeValues", GetEnumeratedDataTypeValues)
@@ -1070,6 +1075,7 @@
     setattr(cls, "updateElementName", updateElementName)
 
     enumerated_datatype_values_xpath = PLCOpen_XPath("ppx:values/ppx:value")
+
     def Search(self, criteria, parent_infos=[]):
         search_result = []
         for i, value in enumerate(enumerated_datatype_values_xpath(self)):
@@ -1094,6 +1100,7 @@
         "ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars]/ppx:variable")
     block_outputs_xpath = PLCOpen_XPath(
         "ppx:interface/*[self::ppx:outputVars or self::ppx:inOutVars]/ppx:variable")
+
     def getblockInfos(self):
         block_infos = {
             "name": self.getname(),
@@ -1626,6 +1633,7 @@
 if cls:
     cls.currentExecutionOrderId = 0
     cls.checkedBlocksDict = {}
+
     def resetcurrentExecutionOrderId(self):
         object.__setattr__(self, "currentExecutionOrderId", 0)
     setattr(cls, "resetcurrentExecutionOrderId", resetcurrentExecutionOrderId)
@@ -1717,6 +1725,7 @@
 
     instance_by_id_xpath = PLCOpen_XPath("*[@localId=$localId]")
     instance_by_name_xpath = PLCOpen_XPath("ppx:block[@instanceName=$name]")
+
     def getcontentInstance(self, local_id):
         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
             instance = instance_by_id_xpath(self.content, localId=local_id)
@@ -2413,6 +2422,7 @@
 
     connection_xpath = PLCOpen_XPath("ppx:connection")
     connection_by_position_xpath = PLCOpen_XPath("ppx:connection[position()=$pos]")
+
     def getconnections(self):
         return connection_xpath(self)
     setattr(cls, "getconnections", getconnections)
--- a/py_ext/PythonFileCTNMixin.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/py_ext/PythonFileCTNMixin.py	Wed Aug 16 12:57:52 2017 +0300
@@ -87,6 +87,7 @@
 
     PreSectionsTexts = {}
     PostSectionsTexts = {}
+
     def GetSection(self, section):
         return self.PreSectionsTexts.get(section, "") + "\n" + \
                getattr(self.CodeFile, section).getanyText() + "\n" + \
--- a/runtime/WampClient.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/runtime/WampClient.py	Wed Aug 16 12:57:52 2017 +0300
@@ -88,6 +88,7 @@
     def clientConnectionFailed(self, connector, reason):
         print("WAMP Client connection failed .. retrying ..")
         self.retry(connector)
+
     def clientConnectionLost(self, connector, reason):
         print("WAMP Client connection lost .. retrying ..")
         self.retry(connector)
--- a/svgui/pyjs/jsonrpc/jsonrpc.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/svgui/pyjs/jsonrpc/jsonrpc.py	Wed Aug 16 12:57:52 2017 +0300
@@ -11,6 +11,7 @@
     def response(self, id, result):
         return simplejson.dumps({'version': '1.1', 'id': id,
                                  'result': result, 'error': None})
+
     def error(self, id, code, message):
         return simplejson.dumps({'id': id,
                                  'version': '1.1',
--- a/targets/Linux/__init__.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/targets/Linux/__init__.py	Wed Aug 16 12:57:52 2017 +0300
@@ -28,7 +28,9 @@
 class Linux_target(toolchain_gcc):
     dlopen_prefix = "./"
     extension = ".so"
+
     def getBuilderCFLAGS(self):
         return toolchain_gcc.getBuilderCFLAGS(self) + ["-fPIC"]
+
     def getBuilderLDFLAGS(self):
         return toolchain_gcc.getBuilderLDFLAGS(self) + ["-shared", "-lrt"]
--- a/targets/Win32/__init__.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/targets/Win32/__init__.py	Wed Aug 16 12:57:52 2017 +0300
@@ -28,5 +28,6 @@
 class Win32_target(toolchain_gcc):
     dlopen_prefix = ""
     extension = ".dll"
+
     def getBuilderLDFLAGS(self):
         return toolchain_gcc.getBuilderLDFLAGS(self) + ["-shared", "-lwinmm"]
--- a/targets/Xenomai/__init__.py	Wed Aug 16 12:53:23 2017 +0300
+++ b/targets/Xenomai/__init__.py	Wed Aug 16 12:57:52 2017 +0300
@@ -28,6 +28,7 @@
 class Xenomai_target(toolchain_gcc):
     dlopen_prefix = "./"
     extension = ".so"
+
     def getXenoConfig(self, flagsname):
         """ Get xeno-config from target parameters """
         xeno_config = self.CTRInstance.GetTarget().getcontent().getXenoConfig()