# HG changeset patch # User Edouard Tisserant # Date 1563086592 -7200 # Node ID e5ce6c4a8672d596c75aa973d75bbd37b4e425ab # Parent 570cf07c3fd1c8f91d5bb900844382de8bb952ab Fixed code quality according to pep8 and pylint. diff -r 570cf07c3fd1 -r e5ce6c4a8672 PLCControler.py --- a/PLCControler.py Sat Jul 13 10:57:25 2019 +0200 +++ b/PLCControler.py Sun Jul 14 08:43:12 2019 +0200 @@ -542,12 +542,12 @@ orig_type = pou.getpouType() if orig_type == 'function' and pou_type in ['functionBlock', 'program']: - # delete return type + # delete return type return_type_obj = new_pou.interface.getreturnType() new_pou.interface.remove(return_type_obj) - # To be ultimately correct we could re-create an - # output variable with same name+_out or so - # but in any case user will have to connect/assign + # To be ultimately correct we could re-create an + # output variable with same name+_out or so + # but in any case user will have to connect/assign # this output, so better leave it as-is new_pou.setpouType(pou_type) diff -r 570cf07c3fd1 -r e5ce6c4a8672 graphics/GraphicCommons.py --- a/graphics/GraphicCommons.py Sat Jul 13 10:57:25 2019 +0200 +++ b/graphics/GraphicCommons.py Sun Jul 14 08:43:12 2019 +0200 @@ -1969,17 +1969,17 @@ # filter duplicates, add corner to diagonals self.Points = [] - lx,ly = None,None + lx, ly = None, None for x, y in points: ex, ey = lx == x, ly == y if ex and ey: # duplicate continue - if (lx,ly) != (None,None) and not ex and not ey: + if (lx, ly) != (None, None) and not ex and not ey: # diagonal self.Points.append(wx.Point(lx, y)) self.Points.append(wx.Point(x, y)) - lx,ly = x,y + lx, ly = x, y # Calculate the start and end directions self.StartPoint = [None, vector(self.Points[0], self.Points[1])] @@ -1995,8 +1995,8 @@ self.Segments = [] i = 0 while True: - l = len(self.Points) - if i > l - 2: + lp = len(self.Points) + if i > lp - 2: break segment = vector(self.Points[i], self.Points[i + 1]) @@ -2011,7 +2011,7 @@ continue # remove corner when two segments are in opposite direction - if i < l - 2: + if i < lp - 2: next = vector(self.Points[i + 1], self.Points[i + 2]) if is_null_vector(add_vectors(segment, next)): self.Points.pop(i+1) diff -r 570cf07c3fd1 -r e5ce6c4a8672 runtime/PLCObject.py --- a/runtime/PLCObject.py Sat Jul 13 10:57:25 2019 +0200 +++ b/runtime/PLCObject.py Sun Jul 14 08:43:12 2019 +0200 @@ -125,7 +125,6 @@ for callee in self.statuschange: callee(self.PLCStatus) - #@RunInMain def LogMessage(self, *args): if len(args) == 2: level, msg = args diff -r 570cf07c3fd1 -r e5ce6c4a8672 runtime/PyroServer.py --- a/runtime/PyroServer.py Sat Jul 13 10:57:25 2019 +0200 +++ b/runtime/PyroServer.py Sun Jul 14 08:43:12 2019 +0200 @@ -62,10 +62,10 @@ self.daemon.connect(pyro_obj, "PLCObject") when_ready() - self.piper,self.pipew = os.pipe() - self.daemon.requestLoop(others=[self.piper], callback=lambda x:None) + self.piper, self.pipew = os.pipe() + self.daemon.requestLoop(others=[self.piper], callback=lambda x: None) self.piper, self.pipew = None, None - if hasattr(self,'sock'): + if hasattr(self, 'sock'): self.daemon.sock.close() self.Unpublish() diff -r 570cf07c3fd1 -r e5ce6c4a8672 wxglade_hmi/wxglade_hmi.py --- a/wxglade_hmi/wxglade_hmi.py Sat Jul 13 10:57:25 2019 +0200 +++ b/wxglade_hmi/wxglade_hmi.py Sun Jul 14 08:43:12 2019 +0200 @@ -32,7 +32,6 @@ import wx -import util.paths as paths from py_ext import PythonFileCTNMixin