# HG changeset patch # User Andrey Skvortsov # Date 1506939546 -10800 # Node ID 9fd29e8b1393da03c1b999a156973451200a315d # Parent cf5ef4c0deff70ce2cb0ce5879a932109435287b fix pylint warning '(global-variable-not-assigned) Using global for 'X' but no assignment is done' diff -r cf5ef4c0deff -r 9fd29e8b1393 Beremiz_service.py --- a/Beremiz_service.py Mon Oct 02 12:43:01 2017 +0300 +++ b/Beremiz_service.py Mon Oct 02 13:19:06 2017 +0300 @@ -510,7 +510,6 @@ wx_eval_lock.release() def evaluator(tocall, *args, **kwargs): - global main_thread if main_thread == currentThread(): # avoid dead lock if called from the wx mainloop return default_evaluator(tocall, *args, **kwargs) diff -r cf5ef4c0deff -r 9fd29e8b1393 connectors/WAMP/__init__.py --- a/connectors/WAMP/__init__.py Mon Oct 02 12:43:01 2017 +0300 +++ b/connectors/WAMP/__init__.py Mon Oct 02 13:19:06 2017 +0300 @@ -44,13 +44,13 @@ class WampSession(wamp.ApplicationSession): def onJoin(self, details): - global _WampSession, _WampSessionEvent + global _WampSession _WampSession = self _WampSessionEvent.set() print('WAMP session joined for :', self.config.extra["ID"]) def onLeave(self, details): - global _WampSession, _WampSessionEvent + global _WampSession _WampSessionEvent.clear() _WampSession = None print('WAMP session left') @@ -113,7 +113,6 @@ wampfuncname = '.'.join((ID, funcname)) def catcher_func(*args, **kwargs): - global _WampSession if _WampSession is not None: try: return threads.blockingCallFromThread( @@ -132,7 +131,7 @@ class WampPLCObjectProxy(object): def __init__(self): - global _WampSessionEvent, _WampConnection + global _WampConnection if not reactor.running: Thread(target=ThreadProc).start() else: @@ -143,7 +142,6 @@ raise Exception(_("WAMP connection timeout")) def __del__(self): - global _WampConnection _WampConnection.disconnect() # # reactor.stop() diff -r cf5ef4c0deff -r 9fd29e8b1393 controls/DebugVariablePanel/DebugVariableViewer.py --- a/controls/DebugVariablePanel/DebugVariableViewer.py Mon Oct 02 12:43:01 2017 +0300 +++ b/controls/DebugVariablePanel/DebugVariableViewer.py Mon Oct 02 13:19:06 2017 +0300 @@ -83,7 +83,6 @@ """ Init global pens and brushes """ - global HIGHLIGHT if not HIGHLIGHT: HIGHLIGHT['DROP_PEN'] = wx.Pen(wx.Colour(0, 128, 255)) HIGHLIGHT['DROP_BRUSH'] = wx.Brush(wx.Colour(0, 128, 255, 128)) diff -r cf5ef4c0deff -r 9fd29e8b1393 editors/Viewer.py --- a/editors/Viewer.py Mon Oct 02 12:43:01 2017 +0300 +++ b/editors/Viewer.py Mon Oct 02 13:19:06 2017 +0300 @@ -810,7 +810,6 @@ def SetCurrentCursor(self, cursor): if self.Mode != MODE_MOTION: - global CURSORS if self.CurrentCursor != cursor: self.CurrentCursor = cursor self.Editor.SetCursor(CURSORS[cursor]) diff -r cf5ef4c0deff -r 9fd29e8b1393 runtime/WampClient.py --- a/runtime/WampClient.py Mon Oct 02 12:43:01 2017 +0300 +++ b/runtime/WampClient.py Mon Oct 02 13:19:06 2017 +0300 @@ -57,7 +57,6 @@ def GetCallee(name): """ Get Callee or Subscriber corresponding to '.' spearated object path """ - global _PySrv names = name.split('.') obj = _PySrv.plcobj while names: @@ -134,7 +133,6 @@ def GetSession(): - global _WampSession return _WampSession diff -r cf5ef4c0deff -r 9fd29e8b1393 svgui/pyjs/lib/pyjslib.py --- a/svgui/pyjs/lib/pyjslib.py Mon Oct 02 12:43:01 2017 +0300 +++ b/svgui/pyjs/lib/pyjslib.py Mon Oct 02 13:19:06 2017 +0300 @@ -598,7 +598,6 @@ def sort(self, compareFunc=None, keyFunc=None, reverse=False): if not compareFunc: - global cmp compareFunc = cmp if keyFunc and reverse: def thisSort1(a, b): @@ -749,7 +748,6 @@ def sort(self, compareFunc=None, keyFunc=None, reverse=False): if not compareFunc: - global cmp compareFunc = cmp if keyFunc and reverse: def thisSort1(a, b): diff -r cf5ef4c0deff -r 9fd29e8b1393 svgui/pyjs/lib/sys.py --- a/svgui/pyjs/lib/sys.py Mon Oct 02 12:43:01 2017 +0300 +++ b/svgui/pyjs/lib/sys.py Mon Oct 02 13:19:06 2017 +0300 @@ -23,12 +23,10 @@ def getloadpath(): - global loadpath return loadpath def addoverride(module_name, path): - global overrides overrides[module_name] = path diff -r cf5ef4c0deff -r 9fd29e8b1393 tests/tools/check_source.sh --- a/tests/tools/check_source.sh Mon Oct 02 12:43:01 2017 +0300 +++ b/tests/tools/check_source.sh Mon Oct 02 13:19:06 2017 +0300 @@ -214,6 +214,7 @@ enable=$enable,W0311 # (bad-indentation) Bad indentation. Found 16 spaces, expected 12 enable=$enable,W0101 # (unreachable) Unreachable code enable=$enable,E0102 # (function-redefined) method already defined + enable=$enable,W0602 # (global-variable-not-assigned) Using global for 'X' but no assignment is done # enable=$enable,W0403 # relative import # enable=$enable,W0622 # (redefined-builtin) Redefining built-in