clean-up: fix PEP8 E202 whitespace before ')'
--- a/Beremiz_service.py Wed Aug 16 11:47:27 2017 +0300
+++ b/Beremiz_service.py Wed Aug 16 12:03:46 2017 +0300
@@ -287,7 +287,7 @@
elif "wxGTK" in wx.PlatformInfo:
# wxMac can be any size upto 128x128, so leave the source img alone....
- icon = wx.IconFromBitmap(img.ConvertToBitmap() )
+ icon = wx.IconFromBitmap(img.ConvertToBitmap()) def OnTaskBarStartPLC(self, evt):
--- a/ConfigTreeNode.py Wed Aug 16 11:47:27 2017 +0300
+++ b/ConfigTreeNode.py Wed Aug 16 12:03:46 2017 +0300
@@ -294,7 +294,7 @@
# filter locations that start with current IEC location
- [loc for loc in locations if loc["LOC"][0:depth] == new_location ])
+ [loc for loc in locations if loc["LOC"][0:depth] == new_location]) LocationCFilesAndCFLAGS += _LocationCFilesAndCFLAGS
--- a/ProjectController.py Wed Aug 16 11:47:27 2017 +0300
+++ b/ProjectController.py Wed Aug 16 12:03:46 2017 +0300
@@ -562,10 +562,10 @@
def GetLibrariesTypes(self):
- return [ lib.GetTypes() for lib in self.Libraries ]
+ return [lib.GetTypes() for lib in self.Libraries] def GetLibrariesSTCode(self):
- return "\n".join([ lib.GetSTCode() for lib in self.Libraries ])
+ return "\n".join([lib.GetSTCode() for lib in self.Libraries]) def GetLibrariesCCode(self, buildpath):
if len(self.Libraries) == 0:
@@ -788,7 +788,7 @@
# Now extract C files of stdout
- C_files = [ fname for fname in result.splitlines() if fname[-2:] == ".c" or fname[-2:] == ".C" ]
+ C_files = [fname for fname in result.splitlines() if fname[-2:] == ".c" or fname[-2:] == ".C"] # remove those that are not to be compiled because included by others
@@ -798,7 +798,7 @@
C_files = map(lambda filename: os.path.join(buildpath, filename), C_files)
# prepend beremiz include to configuration header
- H_files = [ fname for fname in result.splitlines() if fname[-2:] == ".h" or fname[-2:] == ".H" ]
+ H_files = [fname for fname in result.splitlines() if fname[-2:] == ".h" or fname[-2:] == ".H"] H_files.remove("LOCATED_VARIABLES.h")
H_files = map(lambda filename: os.path.join(buildpath, filename), H_files)
@@ -856,7 +856,7 @@
return ([(C_file_name, self.plcCFLAGS)
- for C_file_name in self.PLCGeneratedCFiles ],
+ for C_file_name in self.PLCGeneratedCFiles], False) # do not expose retreive/publish calls
--- a/canfestival/canfestival.py Wed Aug 16 11:47:27 2017 +0300
+++ b/canfestival/canfestival.py Wed Aug 16 12:03:46 2017 +0300
@@ -223,7 +223,7 @@
current_location = self.GetCurrentLocation()
# define a unique name for the generated C file
prefix = "_".join(map(str, current_location))
- Gen_OD_path = os.path.join(buildpath, "OD_%s.c" % prefix )
+ Gen_OD_path = os.path.join(buildpath, "OD_%s.c" % prefix) # Create a new copy of the model
slave = self.GetCurrentNodeCopy()
slave.SetNodeName("OD_%s" % prefix)
@@ -442,7 +442,7 @@
current_location = self.GetCurrentLocation()
# define a unique name for the generated C file
prefix = "_".join(map(str, current_location))
- Gen_OD_path = os.path.join(buildpath, "OD_%s.c" % prefix )
+ Gen_OD_path = os.path.join(buildpath, "OD_%s.c" % prefix) # Create a new copy of the model with DCF loaded with PDO mappings for desired location
master, pointers = config_utils.GenerateConciseDCF(locations, current_location, self, self.CanFestivalNode.getSync_TPDOs(), "OD_%s" % prefix)
@@ -481,7 +481,7 @@
CTNChildrenTypes = [("CanOpenNode", _NodeListCTN, "CanOpen Master"),
- ("CanOpenSlave", _SlaveCTN, "CanOpen Slave" )]
+ ("CanOpenSlave", _SlaveCTN, "CanOpen Slave")] def GetParamsAttributes(self, path=None):
infos = ConfigTreeNode.GetParamsAttributes(self, path=path)
--- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Wed Aug 16 11:47:27 2017 +0300
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Wed Aug 16 12:03:46 2017 +0300
@@ -452,7 +452,7 @@
y = rect.y + (rect.height - h) / 2
- x = rect.x + (rect.width - w ) / 2
+ x = rect.x + (rect.width - w) / 2 y = rect.y + (- h - offset
else rect.height + offset)
--- a/controls/EnhancedStatusBar.py Wed Aug 16 11:47:27 2017 +0300
+++ b/controls/EnhancedStatusBar.py Wed Aug 16 12:03:46 2017 +0300
@@ -78,7 +78,7 @@
# ---------------------------------------------------------------
class EnhancedStatusBarItem(object):
def __init__(self, widget, pos, horizontalalignment=ESB_ALIGN_CENTER_HORIZONTAL, verticalalignment=ESB_ALIGN_CENTER_VERTICAL):
- self.__dict__.update( locals() )
+ self.__dict__.update(locals()) class EnhancedStatusBar(wx.StatusBar):
--- a/dialogs/DiscoveryDialog.py Wed Aug 16 11:47:27 2017 +0300
+++ b/dialogs/DiscoveryDialog.py Wed Aug 16 12:03:46 2017 +0300
@@ -247,6 +247,6 @@
# "name" is included at the end so that self.removeService
- self.itemDataMap[self.nextItemId] = [ svcname, typename, ip, port, name ]
+ self.itemDataMap[self.nextItemId] = [svcname, typename, ip, port, name] --- a/doc/conf.py Wed Aug 16 11:47:27 2017 +0300
+++ b/doc/conf.py Wed Aug 16 12:03:46 2017 +0300
@@ -58,7 +58,7 @@
-locale_dirs = [ "locale/" ]
+locale_dirs = ["locale/"] # There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
--- a/py_ext/py_ext.py Wed Aug 16 11:47:27 2017 +0300
+++ b/py_ext/py_ext.py Wed Aug 16 12:03:46 2017 +0300
@@ -48,7 +48,7 @@
plc_python_code = plc_python_code % {
- "python_eval_fb_count": python_eval_fb_count }
+ "python_eval_fb_count": python_eval_fb_count} Gen_Pythonfile_path = os.path.join(buildpath, "py_ext.c")
pythonfile = open(Gen_Pythonfile_path, 'w')
--- a/runtime/NevowServer.py Wed Aug 16 11:47:27 2017 +0300
+++ b/runtime/NevowServer.py Wed Aug 16 12:03:46 2017 +0300
@@ -122,7 +122,7 @@
tags.head(render=tags.directive('liveglue')),
- tags.div( render=tags.directive( "MainPage" ))
+ tags.div(render=tags.directive("MainPage")) --- a/svgui/pyjs/build.py Wed Aug 16 11:47:27 2017 +0300
+++ b/svgui/pyjs/build.py Wed Aug 16 12:03:46 2017 +0300
@@ -138,19 +138,17 @@
- filename = os.path.split ( source_file )[1]
- mod_name = os.path.splitext ( filename )[0]
- file_name = os.path.join ( dest_path, mod_name + '.html' )
+ filename = os.path.split (source_file)[1] + mod_name = os.path.splitext(filename)[0] + file_name = os.path.join (dest_path, mod_name + '.html') # if html file in output directory exists, leave it alone.
- if os.path.exists ( file_name ):
+ if os.path.exists (file_name):
- os.path.join ( dest_path, mod_name + '.css' ) ):
+ if os.path.exists(os.path.join(dest_path, mod_name + '.css')): css = "<link rel='stylesheet' href='" + mod_name + ".css'>"
- os.path.join ( dest_path, 'pyjamas_default.css' ) ):
+ elif os.path.exists(os.path.join(dest_path, 'pyjamas_default.css')): css = "<link rel='stylesheet' href='pyjamas_default.css'>"
--- a/svgui/pyjs/jsonrpc/django/jsonrpc.py Wed Aug 16 11:47:27 2017 +0300
+++ b/svgui/pyjs/jsonrpc/django/jsonrpc.py Wed Aug 16 12:03:46 2017 +0300
@@ -171,7 +171,7 @@
return {'success': False, 'errors': builderrors(f)}
instance = f.save() # XXX: if you want more, over-ride save.
- return {'success': True, 'instance': json_convert(instance) }
+ return {'success': True, 'instance': json_convert(instance)} elif command.has_key('html'):
return {'success': True, 'html': f.as_table()}
--- a/svgui/pyjs/pyjs.py Wed Aug 16 11:47:27 2017 +0300
+++ b/svgui/pyjs/pyjs.py Wed Aug 16 12:03:46 2017 +0300
@@ -543,7 +543,7 @@
return ("pyjs_kwargs_function_call("+call_name+", "
return ("pyjs_kwargs_method_call("+call_this+", '"+method_name+"', "
@@ -588,7 +588,7 @@
l.append("(%(err)s.__name__ == %(expr)s.__name__)" % dict (err=errName, expr=self.expr(x, current_klass)))
- l = [ " (%(err)s.__name__ == %(expr)s.__name__) " % dict (err=errName, expr=self.expr(expr, current_klass)) ]
+ l = [" (%(err)s.__name__ == %(expr)s.__name__) " % dict (err=errName, expr=self.expr(expr, current_klass))] print >> self.output, " if(%s) {" % '||\n\t\t'.join(l)
for stmt in node.handlers[0][2]:
self._stmt(stmt, current_klass)
@@ -670,7 +670,7 @@
elif v.name in self.module_imports() and return_none_for_module:
elif v.name in PYJSLIB_BUILTIN_CLASSES:
- return "pyjslib." + pyjs_builtin_remap( v.name )
+ return "pyjslib." + pyjs_builtin_remap(v.name) if v.name not in local_var_names and \
v.name not in self.top_level_vars and \
--- a/util/ProcessLogger.py Wed Aug 16 11:47:27 2017 +0300
+++ b/util/ProcessLogger.py Wed Aug 16 12:03:46 2017 +0300
@@ -135,7 +135,7 @@
- self.Proc = subprocess.Popen( self.Command, **popenargs )
+ self.Proc = subprocess.Popen(self.Command, **popenargs) self.outt = outputThread(
--- a/util/Zeroconf.py Wed Aug 16 11:47:27 2017 +0300
+++ b/util/Zeroconf.py Wed Aug 16 12:03:46 2017 +0300
@@ -159,7 +159,7 @@
@@ -179,7 +179,7 @@