clean-up: fix PEP8 E201 whitespace after '{'
--- a/Beremiz_service.py Wed Aug 16 12:03:46 2017 +0300
+++ b/Beremiz_service.py Wed Aug 16 12:21:05 2017 +0300
@@ -310,7 +310,7 @@
ip_addr = '' if ip_addr is None else ip_addr
dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=ip_addr)
dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")),
- ( lambda x:len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, _("IP is not valid!"))
+ (lambda x:len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, _("IP is not valid!")) if dlg.ShowModal() == wx.ID_OK:
self.pyroserver.ip_addr = dlg.GetValue()
--- a/ConfigTreeNode.py Wed Aug 16 12:03:46 2017 +0300
+++ b/ConfigTreeNode.py Wed Aug 16 12:21:05 2017 +0300
@@ -323,7 +323,7 @@
# if Name have other components
# Recurse in order to find the latest object
- return CTNInstance._GetChildBySomething( something, toks[1:])
+ return CTNInstance._GetChildBySomething(something, toks[1:]) --- a/PLCGenerator.py Wed Aug 16 12:03:46 2017 +0300
+++ b/PLCGenerator.py Wed Aug 16 12:21:05 2017 +0300
@@ -1393,7 +1393,7 @@
jump_target = jump.gettargetName()
if not pou.hasstep(jump_target):
- msg = _("SFC jump in pou \"{a1}\" refers to non-existent SFC step \"{a2}\"").format( a1=pname, a2=jump_target)
+ msg = _("SFC jump in pou \"{a1}\" refers to non-existent SFC step \"{a2}\"").format(a1=pname, a2=jump_target) raise PLCGenException, msg
if jump.connectionPointIn is not None:
--- a/canfestival/config_utils.py Wed Aug 16 12:03:46 2017 +0300
+++ b/canfestival/config_utils.py Wed Aug 16 12:21:05 2017 +0300
@@ -667,7 +667,7 @@
subentry_infos = slave.GetSubentryInfos(index, subindex)
if subentry_infos["type"] != COlocationtype:
raise PDOmappingException, _("Invalid type \"{a1}\"-> {a2} != {a3} for location \"{a4}\"").\
- format( a1=location["IEC_TYPE"], a2=COlocationtype, a3=subentry_infos["type"], a4=name)
+ format(a1=location["IEC_TYPE"], a2=COlocationtype, a3=subentry_infos["type"], a4=name) IECLocations[name] = COlocationtype
pointers[(index, subindex)] = name
--- a/connectors/WAMP/__init__.py Wed Aug 16 12:03:46 2017 +0300
+++ b/connectors/WAMP/__init__.py Wed Aug 16 12:21:05 2017 +0300
@@ -52,10 +52,12 @@
print 'WAMP session left'
-PLCObjDefaults = { "StartPLC": False,
- "GetTraceVariables": ("Broken", None),
- "GetPLCstatus": ("Broken", None),
- "RemoteExec": (-1, "RemoteExec script failed!")}
+ "GetTraceVariables": ("Broken", None), + "GetPLCstatus": ("Broken", None), + "RemoteExec": (-1, "RemoteExec script failed!") def WAMP_connector_factory(uri, confnodesroot):
--- a/controls/CustomStyledTextCtrl.py Wed Aug 16 12:03:46 2017 +0300
+++ b/controls/CustomStyledTextCtrl.py Wed Aug 16 12:21:05 2017 +0300
@@ -26,19 +26,21 @@
if wx.Platform == '__WXMSW__':
- faces = { 'times': 'Times New Roman',
- 'other': 'Comic Sans MS',
+ 'times': 'Times New Roman', + 'other': 'Comic Sans MS', - faces = { 'times': 'Times',
- 'other': 'new century schoolbook',
+ 'other': 'new century schoolbook', --- a/editors/ConfTreeNodeEditor.py Wed Aug 16 12:03:46 2017 +0300
+++ b/editors/ConfTreeNodeEditor.py Wed Aug 16 12:21:05 2017 +0300
@@ -37,19 +37,21 @@
from util.BitmapLibrary import GetBitmap
if wx.Platform == '__WXMSW__':
- faces = { 'times': 'Times New Roman',
- 'other': 'Comic Sans MS',
+ 'times': 'Times New Roman', + 'other': 'Comic Sans MS', - faces = { 'times': 'Times',
- 'other': 'new century schoolbook',
+ 'other': 'new century schoolbook', --- a/editors/TextViewer.py Wed Aug 16 12:03:46 2017 +0300
+++ b/editors/TextViewer.py Wed Aug 16 12:21:05 2017 +0300
@@ -278,8 +278,8 @@
self.RefreshVariableTree()
blockinfo = self.Controler.GetBlockType(blocktype, blockinputs, self.Debug)
- [ " " + fctdecl[0]+" := (*"+fctdecl[1]+"*)" for fctdecl in blockinfo["inputs"]] +
- [ " " + fctdecl[0]+" => (*"+fctdecl[1]+"*)" for fctdecl in blockinfo["outputs"]])
+ [" " + fctdecl[0]+" := (*"+fctdecl[1]+"*)" for fctdecl in blockinfo["inputs"]] + + [" " + fctdecl[0]+" => (*"+fctdecl[1]+"*)" for fctdecl in blockinfo["outputs"]]) if values[1] == "function":
event.SetDragText(blocktype+"(\n "+hint+")")
--- a/editors/Viewer.py Wed Aug 16 12:03:46 2017 +0300
+++ b/editors/Viewer.py Wed Aug 16 12:21:05 2017 +0300
@@ -65,19 +65,21 @@
parent.Append(helpString=help, id=id, kind=kind, item=text)
if wx.Platform == '__WXMSW__':
- faces = { 'times': 'Times New Roman',
- 'other': 'Comic Sans MS',
+ 'times': 'Times New Roman', + 'other': 'Comic Sans MS', - faces = { 'times': 'Times',
- 'other': 'new century schoolbook',
+ 'other': 'new century schoolbook', if wx.Platform == '__WXMSW__':
--- a/plcopen/structures.py Wed Aug 16 12:03:46 2017 +0300
+++ b/plcopen/structures.py Wed Aug 16 12:21:05 2017 +0300
@@ -100,7 +100,7 @@
take a .csv file and translate it it a "csv_table"
- return [ map(string.strip, line.split(';')) for line in file.xreadlines()]
+ return [map(string.strip, line.split(';')) for line in file.xreadlines()] def find_section(section_name, table):
@@ -230,7 +230,7 @@
for outype in output_types:
decl_tpl = Function_decl["outputs"][0]
- Function_decl["outputs"] = [ (decl_tpl[0], outype, decl_tpl[2])]
+ Function_decl["outputs"] = [(decl_tpl[0], outype, decl_tpl[2])] if funcdeclname_orig.endswith('*'):
funcdeclout = funcdeclin + '_' + outype
--- a/svgui/svgui_server.py Wed Aug 16 12:03:46 2017 +0300
+++ b/svgui/svgui_server.py Wed Aug 16 12:21:05 2017 +0300
@@ -91,19 +91,21 @@
# Convert objects to a dictionary of their representation
- d = { '__class__': obj.classname,
- 'kwargs': json.dumps(attrs),
+ '__class__': obj.classname, + 'kwargs': json.dumps(attrs), def get_object_current_state(obj):
# Convert objects to a dictionary of their representation
- d = { '__class__': obj.classname,
- 'kwargs': json.dumps(obj.outputs),
+ '__class__': obj.classname, + 'kwargs': json.dumps(obj.outputs), --- a/targets/__init__.py Wed Aug 16 12:03:46 2017 +0300
+++ b/targets/__init__.py Wed Aug 16 12:21:05 2017 +0300
@@ -45,7 +45,7 @@
targets = dict([(name, {"xsd": path.join(_base_path, name, "XSD"),
"class": _GetLocalTargetClassFactory(name),
- "code": { fname: path.join(_base_path, name, fname)
+ "code": {fname: path.join(_base_path, name, fname) for fname in listdir(path.join(_base_path, name))
if fname.startswith("plc_%s_main" % name) and
--- a/targets/toolchain_makefile.py Wed Aug 16 12:03:46 2017 +0300
+++ b/targets/toolchain_makefile.py Wed Aug 16 12:21:05 2017 +0300
@@ -115,7 +115,7 @@
# clean sequence of multiple whitespaces
cmd = re.sub(r"[ ]+", " ", target.getCommand().strip())
- command = [ token % beremizcommand for token in cmd.split(' ')]
+ command = [token % beremizcommand for token in cmd.split(' ')] # Call Makefile to build PLC code and link it with target specific code
status, result, err_result = ProcessLogger(self.CTRInstance.logger,
--- a/targets/typemapping.py Wed Aug 16 12:03:46 2017 +0300
+++ b/targets/typemapping.py Wed Aug 16 12:21:05 2017 +0300
@@ -102,8 +102,8 @@
TypeTranslator.get(iectype,
if c_type is not None and buffoffset < buffsize:
- cursor = c_void_p( buffptr + buffoffset)
- value = unpack_func( cast(cursor,
+ cursor = c_void_p(buffptr + buffoffset) + value = unpack_func(cast(cursor, POINTER(c_type)).contents)
buffoffset += sizeof(c_type) if iectype != "STRING" else len(value)+1
--- a/util/Zeroconf.py Wed Aug 16 12:03:46 2017 +0300
+++ b/util/Zeroconf.py Wed Aug 16 12:21:05 2017 +0300
@@ -154,32 +154,36 @@
# Mapping constants to names
-_CLASSES = { _CLASS_IN: "in",
-_TYPES = { _TYPE_A: "a",