clean-up: fix PEP8 E272 multiple spaces before keyword
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Sat, 19 Aug 2017 01:11:27 +0300
changeset 1774 ac0fe8aabb5e
parent 1773 38fde37c3766
child 1775 b45f2768fab1
clean-up: fix PEP8 E272 multiple spaces before keyword
PLCControler.py
controls/DebugVariablePanel/DebugVariableItem.py
controls/VariablePanel.py
editors/CodeFileEditor.py
plcopen/structures.py
targets/typemapping.py
xmlclass/xmlclass.py
xmlclass/xsdschema.py
--- a/PLCControler.py	Sat Aug 19 00:58:44 2017 +0300
+++ b/PLCControler.py	Sat Aug 19 01:11:27 2017 +0300
@@ -415,7 +415,7 @@
         specific_values_tuple, specific_values_translation = \
             _SpecificValuesTuples.get(args[0][0], _BlockSpecificValues)
 
-        if args[0][0] == "step"       and len(self.SpecificValues) < 3 or \
+        if args[0][0] == "step" and len(self.SpecificValues) < 3 or \
            args[0][0] == "transition" and len(self.SpecificValues) < 4:
             self.SpecificValues.append([None])
         elif args[0][0] == "actionBlock" and len(self.SpecificValues) < 1:
--- a/controls/DebugVariablePanel/DebugVariableItem.py	Sat Aug 19 00:58:44 2017 +0300
+++ b/controls/DebugVariablePanel/DebugVariableItem.py	Sat Aug 19 01:11:27 2017 +0300
@@ -308,7 +308,7 @@
         @param value: New value
         """
         # Remove quote and double quote surrounding string value to get raw value
-        if self.VariableType == "STRING"  and value.startswith("'") and value.endswith("'") or \
+        if self.VariableType == "STRING" and value.startswith("'") and value.endswith("'") or \
            self.VariableType == "WSTRING" and value.startswith('"') and value.endswith('"'):
             value = value[1:-1]
 
--- a/controls/VariablePanel.py	Sat Aug 19 00:58:44 2017 +0300
+++ b/controls/VariablePanel.py	Sat Aug 19 01:11:27 2017 +0300
@@ -91,12 +91,12 @@
 VARIABLE_CLASSES_DICT = dict([(_(_class), _class) for _class in GetFilterChoiceTransfer().itervalues()])
 
 CheckOptionForClass = {
-    "Local":    lambda x: x,
-    "Temp":     lambda x: "",
-    "Input":    lambda x: {"Retain": "Retain", "Non-Retain": "Non-Retain"}.get(x, ""),
-    "InOut":    lambda x: "",
-    "Output":   lambda x: {"Retain": "Retain", "Non-Retain": "Non-Retain"}.get(x, ""),
-    "Global":   lambda x: {"Constant": "Constant", "Retain": "Retain"}.get(x, ""),
+    "Local": lambda x: x,
+    "Temp": lambda x: "",
+    "Input": lambda x: {"Retain": "Retain", "Non-Retain": "Non-Retain"}.get(x, ""),
+    "InOut": lambda x: "",
+    "Output": lambda x: {"Retain": "Retain", "Non-Retain": "Non-Retain"}.get(x, ""),
+    "Global": lambda x: {"Constant": "Constant", "Retain": "Retain"}.get(x, ""),
     "External": lambda x: {"Constant": "Constant"}.get(x, "")
 }
 
--- a/editors/CodeFileEditor.py	Sat Aug 19 00:58:44 2017 +0300
+++ b/editors/CodeFileEditor.py	Sat Aug 19 01:11:27 2017 +0300
@@ -384,7 +384,7 @@
         if braceAtCaret >= 0:
             braceOpposite = self.BraceMatch(braceAtCaret)
 
-        if braceAtCaret != -1  and braceOpposite == -1:
+        if braceAtCaret != -1 and braceOpposite == -1:
             self.BraceBadLight(braceAtCaret)
         else:
             self.BraceHighlight(braceAtCaret, braceOpposite)
--- a/plcopen/structures.py	Sat Aug 19 00:58:44 2017 +0300
+++ b/plcopen/structures.py	Sat Aug 19 01:11:27 2017 +0300
@@ -178,8 +178,8 @@
 
     translate = {
             "extensible": lambda x: {"yes": True, "no": False}[x],
-            "inputs":     lambda x: csv_input_translate(x, variables, baseinputnumber),
-            "outputs":    lambda x: [("OUT", x, "none")]}
+            "inputs": lambda x: csv_input_translate(x, variables, baseinputnumber),
+            "outputs": lambda x: [("OUT", x, "none")]}
 
     for fields in table:
         if fields[1]:
--- a/targets/typemapping.py	Sat Aug 19 00:58:44 2017 +0300
+++ b/targets/typemapping.py	Sat Aug 19 01:11:27 2017 +0300
@@ -56,7 +56,7 @@
 
 
 SameEndianessTypeTranslator = {
-    "BOOL":       _t(c_uint8,  lambda x: x.value != 0),
+    "BOOL":       _t(c_uint8, lambda x: x.value != 0),
     "STEP":       _t(c_uint8),
     "TRANSITION": _t(c_uint8),
     "ACTION":     _t(c_uint8),
--- a/xmlclass/xmlclass.py	Sat Aug 19 00:58:44 2017 +0300
+++ b/xmlclass/xmlclass.py	Sat Aug 19 01:11:27 2017 +0300
@@ -894,7 +894,7 @@
                 raise ValueError("Invalid attribute \"%s\" for member \"%s\"!" % (qualified_name, node.nodeName))
         for attr in valid_attrs:
             if attr not in attrs and \
-               attr      in self.Namespaces[self.SchemaNamespace] and \
+               attr in self.Namespaces[self.SchemaNamespace] and \
                "default" in self.Namespaces[self.SchemaNamespace][attr]:
                 if element_name in self.Namespaces[self.SchemaNamespace][attr]["default"]:
                     default = self.Namespaces[self.SchemaNamespace][attr]["default"][element_name]
--- a/xmlclass/xsdschema.py	Sat Aug 19 00:58:44 2017 +0300
+++ b/xmlclass/xsdschema.py	Sat Aug 19 01:11:27 2017 +0300
@@ -318,7 +318,7 @@
                         raise ValueError("value must be greater than %s" % str(facetvalue))
                     elif facetname == "maxInclusive" and value > facetvalue:
                         raise ValueError("value must be lesser than or equal to %s" % str(facetvalue))
-                    elif facetname == "maxExclusive"  and value >= facetvalue:
+                    elif facetname == "maxExclusive" and value >= facetvalue:
                         raise ValueError("value must be lesser than %s" % str(facetvalue))
                     elif facetname == "pattern":
                         model = re.compile("(?:%s)?$" % "|".join(map(lambda x: "(?:%s)" % x, facetvalue)))
@@ -352,7 +352,7 @@
                         return False
                     elif facetname == "maxInclusive" and value > facetvalue:
                         return False
-                    elif facetname == "maxExclusive"  and value >= facetvalue:
+                    elif facetname == "maxExclusive" and value >= facetvalue:
                         return False
                     elif facetname == "pattern":
                         model = re.compile("(?:%s)?$" % "|".join(map(lambda x: "(?:%s)" % x, facetvalue)))
@@ -379,7 +379,7 @@
                         return facetvalue + 1
                     elif facetname == "maxInclusive" and facetvalue < 0:
                         return facetvalue
-                    elif facetname == "maxExclusive"  and facetvalue <= 0:
+                    elif facetname == "maxExclusive" and facetvalue <= 0:
                         return facetvalue - 1
             return basetypeinfos["initial"]()