fix unnecessary parens after keyword
--- a/Beremiz_service.py Fri Sep 22 10:57:57 2017 +0300
+++ b/Beremiz_service.py Fri Sep 22 16:37:38 2017 +0300
@@ -514,7 +514,7 @@
def evaluator(tocall, *args, **kwargs):
- if(main_thread == currentThread()):
+ if main_thread == currentThread(): # avoid dead lock if called from the wx mainloop
return default_evaluator(tocall, *args, **kwargs)
--- a/ConfigTreeNode.py Fri Sep 22 10:57:57 2017 +0300
+++ b/ConfigTreeNode.py Fri Sep 22 16:37:38 2017 +0300
@@ -567,7 +567,7 @@
# Load the confnode.xml file into parameters members
_self.LoadXMLParams(NewCTNName)
# Basic check. Better to fail immediately.
- if (_self.BaseParams.getName() != NewCTNName):
+ if _self.BaseParams.getName() != NewCTNName: _("Project tree layout do not match confnode.xml {a1}!={a2} ").
format(a1=NewCTNName, a2=_self.BaseParams.getName()))
--- a/ProjectController.py Fri Sep 22 10:57:57 2017 +0300
+++ b/ProjectController.py Fri Sep 22 16:37:38 2017 +0300
@@ -1361,7 +1361,7 @@
self._SetConnector(None, False)
- if(self.previous_plcstate != status):
+ if self.previous_plcstate != status: "Started": [("_Run", False),
--- a/canfestival/canfestival.py Fri Sep 22 10:57:57 2017 +0300
+++ b/canfestival/canfestival.py Fri Sep 22 16:37:38 2017 +0300
@@ -127,7 +127,7 @@
# TODO change netname when name change
NodeManager.__init__(self)
odfilepath = self.GetSlaveODPath()
- if(os.path.isfile(odfilepath)):
+ if os.path.isfile(odfilepath): self.OpenFileInCurrent(odfilepath)
--- a/controls/DebugVariablePanel/DebugVariablePanel.py Fri Sep 22 10:57:57 2017 +0300
+++ b/controls/DebugVariablePanel/DebugVariablePanel.py Fri Sep 22 16:37:38 2017 +0300
@@ -787,7 +787,7 @@
if source_panel is not None:
source_panel_idx = self.GraphicPanels.index(source_panel)
- if (len(source_panel.GetItems()) == 1):
+ if len(source_panel.GetItems()) == 1: if source_panel_idx < idx:
self.GraphicPanels.insert(idx, source_panel)
@@ -857,7 +857,7 @@
source_panel.ReleaseMouse()
self.GraphicPanels.remove(source_panel)
- elif (merge_type != graph_type and len(target_panel.Items) == 2):
+ elif merge_type != graph_type and len(target_panel.Items) == 2: target_panel.RemoveItem(source_item)
--- a/docutil/docpdf.py Fri Sep 22 10:57:57 2017 +0300
+++ b/docutil/docpdf.py Fri Sep 22 16:37:38 2017 +0300
@@ -72,13 +72,13 @@
readerexepath = os.path.join(readerpath, "AcroRd32.exe")
- if(os.path.isfile(readerexepath)):
+ if os.path.isfile(readerexepath): open_win_pdf(readerexepath, pdffile, pagenum)
readerexepath = os.path.join("/usr/bin", "xpdf")
- if(os.path.isfile(readerexepath)):
+ if os.path.isfile(readerexepath): open_lin_pdf(readerexepath, pdffile, pagenum)
wx.MessageBox("xpdf is not found or installed !")
--- a/docutil/docsvg.py Fri Sep 22 10:57:57 2017 +0300
+++ b/docutil/docsvg.py Fri Sep 22 16:37:38 2017 +0300
@@ -64,7 +64,7 @@
svgexepath = os.path.join("/usr/bin", "inkscape")
- if(os.path.isfile(svgexepath)):
+ if os.path.isfile(svgexepath): open_lin_svg(svgexepath, svgfile)
wx.MessageBox("Inkscape is not found or installed !")
--- a/editors/SFCViewer.py Fri Sep 22 10:57:57 2017 +0300
+++ b/editors/SFCViewer.py Fri Sep 22 16:37:38 2017 +0300
@@ -346,7 +346,7 @@
(isinstance(startblock, SFC_Objects) or isinstance(endblock, SFC_Objects)):
# Full "SFC_StandardRules" table would be symmetrical and
# to avoid duplicate records and minimize the table only upper part is defined.
- if (direction == SOUTH or direction == EAST):
+ if direction == SOUTH or direction == EAST: startblock, endblock = endblock, startblock
start = self.GetBlockName(startblock)
end = self.GetBlockName(endblock)
--- a/graphics/GraphicCommons.py Fri Sep 22 10:57:57 2017 +0300
+++ b/graphics/GraphicCommons.py Fri Sep 22 16:37:38 2017 +0300
@@ -2652,7 +2652,7 @@
scalex, scaley = dc.GetUserScale()
# If user trying to connect wire with wrong input, highlight will become red.
- if self.ErrHighlight and not (self.EndConnected):
+ if self.ErrHighlight and not self.EndConnected: highlightcolor = HIGHLIGHTCOLOR
--- a/i18n/mki18n.py Fri Sep 22 10:57:57 2017 +0300
+++ b/i18n/mki18n.py Fri Sep 22 16:37:38 2017 +0300
@@ -467,7 +467,7 @@
for (opt, val) in optionList:
option[optionKey[opt]] = 1 if val == '' else val
--- a/plcopen/structures.py Fri Sep 22 10:57:57 2017 +0300
+++ b/plcopen/structures.py Fri Sep 22 16:37:38 2017 +0300
@@ -110,7 +110,7 @@
return the matching row without first field
- while(fields[0] != section_name):
+ while fields[0] != section_name: @@ -123,7 +123,7 @@
variables = find_section("Standard_functions_variables_types", table)
standard_funtions_input_variables = {}
variable_from_csv = dict([(champ, val) for champ, val in zip(variables, fields[1:]) if champ != ''])
standard_funtions_input_variables[variable_from_csv['name']] = variable_from_csv['type']
--- a/svgui/pyjs/lib/pyjslib.py Fri Sep 22 10:57:57 2017 +0300
+++ b/svgui/pyjs/lib/pyjslib.py Fri Sep 22 16:37:38 2017 +0300
@@ -987,7 +987,7 @@
- if(isString(x) and len(x) is 1):
+ if isString(x) and len(x) is 1: --- a/tests/tools/check_source.sh Fri Sep 22 10:57:57 2017 +0300
+++ b/tests/tools/check_source.sh Fri Sep 22 16:37:38 2017 +0300
@@ -203,7 +203,8 @@
enable=$enable,E1601 # print statement used
# enable=$enable,W0403 # relative import
+ enable=$enable,C0325 # (superfluous-parens) Unnecessary parens after keyword options="$options --rcfile=.pylint"
--- a/util/Zeroconf.py Fri Sep 22 10:57:57 2017 +0300
+++ b/util/Zeroconf.py Fri Sep 22 16:37:38 2017 +0300
@@ -903,7 +903,7 @@
def delReader(self, socket):
- del(self.readers[socket])
+ del self.readers[socket] @@ -1001,7 +1001,7 @@
return self.listener.removeService(x, self.type, record.alias)
- del(self.services[record.alias.lower()])
+ del self.services[record.alias.lower()] self.list.append(callback)
@@ -1348,7 +1348,7 @@
for browser in self.browsers:
if browser.listener == listener:
def registerService(self, info, ttl=_DNS_TTL):
"""Registers service information to the network with a default TTL
@@ -1378,7 +1378,7 @@
def unregisterService(self, info):
"""Unregister a service."""
- del(self.services[info.name.lower()])
+ del self.services[info.name.lower()] now = currentTimeMillis()
@@ -1430,7 +1430,7 @@
for record in self.cache.entriesWithName(info.type):
if record.type == _TYPE_PTR and not record.isExpired(now) and record.alias == info.name:
- if (info.name.find('.') < 0):
+ if info.name.find('.') < 0: info.name = info.name + ".[" + info.address + ":" + info.port + "]." + info.type