# HG changeset patch # User Andrey Skvortsov # Date 1507301554 -10800 # Node ID 614396cbffbfb7eac6d025146ec77f487ba99419 # Parent 6811021e3d94ddecc62e4d83b40995b06e6f5822 fix pylint warning '(unused-import), Unused import connectors' diff -r 6811021e3d94 -r 614396cbffbf BeremizIDE.py --- a/BeremizIDE.py Thu Oct 05 16:46:29 2017 +0300 +++ b/BeremizIDE.py Fri Oct 06 17:52:34 2017 +0300 @@ -29,9 +29,7 @@ import tempfile import shutil import random -import re import types -import commands import time from time import time as gettime from threading import Lock, Timer, currentThread @@ -43,7 +41,6 @@ import version -from docutil import OpenHtmlFrame from editors.EditorPanel import EditorPanel from editors.Viewer import Viewer from editors.TextViewer import TextViewer @@ -79,7 +76,6 @@ PROJECTTREE,\ POUINSTANCEVARIABLESPANEL,\ LIBRARYTREE,\ - SCALING,\ PAGETITLES,\ IDEFrame, \ AppendMenu,\ diff -r 6811021e3d94 -r 614396cbffbf Beremiz_service.py --- a/Beremiz_service.py Thu Oct 05 16:46:29 2017 +0300 +++ b/Beremiz_service.py Fri Oct 06 17:52:34 2017 +0300 @@ -28,14 +28,13 @@ import os import sys import getopt -import gettext import threading from threading import Thread, currentThread, Semaphore import traceback import __builtin__ import Pyro.core as pyro -from runtime import PLCObject, PLCprint, ServicePublisher +from runtime import PLCObject, ServicePublisher import util.paths as paths diff -r 6811021e3d94 -r 614396cbffbf ConfigTreeNode.py --- a/ConfigTreeNode.py Thu Oct 05 16:46:29 2017 +0300 +++ b/ConfigTreeNode.py Fri Oct 06 17:52:34 2017 +0300 @@ -38,9 +38,8 @@ from lxml import etree from xmlclass import GenerateParserFromXSDstring -from util.misc import GetClassImporter - -from PLCControler import PLCControler, LOCATION_CONFNODE + +from PLCControler import LOCATION_CONFNODE from editors.ConfTreeNodeEditor import ConfTreeNodeEditor _BaseParamsParser = GenerateParserFromXSDstring(""" diff -r 6811021e3d94 -r 614396cbffbf IDEFrame.py --- a/IDEFrame.py Thu Oct 05 16:46:29 2017 +0300 +++ b/IDEFrame.py Fri Oct 06 17:52:34 2017 +0300 @@ -22,7 +22,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import os import sys import cPickle from types import TupleType diff -r 6811021e3d94 -r 614396cbffbf NativeLib.py --- a/NativeLib.py Thu Oct 05 16:46:29 2017 +0300 +++ b/NativeLib.py Fri Oct 06 17:52:34 2017 +0300 @@ -23,7 +23,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import os import util.paths as paths from POULibrary import POULibrary diff -r 6811021e3d94 -r 614396cbffbf PLCControler.py --- a/PLCControler.py Thu Oct 05 16:46:29 2017 +0300 +++ b/PLCControler.py Fri Oct 06 17:52:34 2017 +0300 @@ -23,11 +23,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -from xml.dom import minidom -from types import StringType, UnicodeType, TupleType + +from types import TupleType from copy import deepcopy import os -import sys import re import datetime from time import localtime diff -r 6811021e3d94 -r 614396cbffbf PLCOpenEditor.py --- a/PLCOpenEditor.py Thu Oct 05 16:46:29 2017 +0300 +++ b/PLCOpenEditor.py Fri Oct 06 17:52:34 2017 +0300 @@ -45,8 +45,8 @@ PROJECTTREE, \ POUINSTANCEVARIABLESPANEL, \ LIBRARYTREE, \ - PAGETITLES -from IDEFrame import EncodeFileSystemPath, DecodeFileSystemPath + PAGETITLES, \ + DecodeFileSystemPath from editors.Viewer import Viewer from PLCControler import PLCControler from dialogs import ProjectDialog diff -r 6811021e3d94 -r 614396cbffbf ProjectController.py --- a/ProjectController.py Thu Oct 05 16:46:29 2017 +0300 +++ b/ProjectController.py Fri Oct 06 17:52:34 2017 +0300 @@ -27,14 +27,12 @@ Beremiz Project Controller """ import os -import sys import traceback import time from time import localtime import shutil import re import tempfile -from math import ceil from types import ListType from threading import Timer, Lock, Thread from datetime import datetime @@ -58,8 +56,7 @@ from PLCControler import PLCControler from plcopen.structures import IEC_KEYWORDS import targets -from targets.typemapping import DebugTypesSize, \ - LogLevelsCount, LogLevels, UnpackDebugBuffer +from targets.typemapping import DebugTypesSize, UnpackDebugBuffer from ConfigTreeNode import ConfigTreeNode, XSDSchemaErrorMessage base_folder = paths.AbsParentDir(__file__) diff -r 6811021e3d94 -r 614396cbffbf canfestival/NetworkEditor.py --- a/canfestival/NetworkEditor.py Thu Oct 05 16:46:29 2017 +0300 +++ b/canfestival/NetworkEditor.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,7 +24,6 @@ import wx -from subindextable import EditingPanel from networkeditortemplate import NetworkEditorTemplate from editors.ConfTreeNodeEditor import ConfTreeNodeEditor diff -r 6811021e3d94 -r 614396cbffbf canfestival/canfestival.py --- a/canfestival/canfestival.py Thu Oct 05 16:46:29 2017 +0300 +++ b/canfestival/canfestival.py Fri Oct 06 17:52:34 2017 +0300 @@ -35,10 +35,6 @@ from ConfigTreeNode import ConfigTreeNode from PLCControler import \ LOCATION_CONFNODE, \ - LOCATION_MODULE, \ - LOCATION_GROUP, \ - LOCATION_VAR_INPUT, \ - LOCATION_VAR_OUTPUT, \ LOCATION_VAR_MEMORY try: diff -r 6811021e3d94 -r 614396cbffbf controls/CustomIntCtrl.py --- a/controls/CustomIntCtrl.py Thu Oct 05 16:46:29 2017 +0300 +++ b/controls/CustomIntCtrl.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,7 +24,7 @@ import wx -from wx.lib.intctrl import IntCtrl +import wx.lib.intctrl class CustomIntUpdatedEvent(wx.PyCommandEvent): diff -r 6811021e3d94 -r 614396cbffbf controls/DebugVariablePanel/DebugVariableGraphicViewer.py --- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Thu Oct 05 16:46:29 2017 +0300 +++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Fri Oct 06 17:52:34 2017 +0300 @@ -36,7 +36,6 @@ from mpl_toolkits.mplot3d import Axes3D from editors.DebugViewer import REFRESH_PERIOD -from DebugVariableItem import DebugVariableItem from DebugVariableViewer import * from GraphButton import GraphButton diff -r 6811021e3d94 -r 614396cbffbf controls/DebugVariablePanel/DebugVariablePanel.py --- a/controls/DebugVariablePanel/DebugVariablePanel.py Thu Oct 05 16:46:29 2017 +0300 +++ b/controls/DebugVariablePanel/DebugVariablePanel.py Fri Oct 06 17:52:34 2017 +0300 @@ -23,7 +23,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from types import TupleType -import math import numpy import wx diff -r 6811021e3d94 -r 614396cbffbf controls/DebugVariablePanel/DebugVariableTextViewer.py --- a/controls/DebugVariablePanel/DebugVariableTextViewer.py Thu Oct 05 16:46:29 2017 +0300 +++ b/controls/DebugVariablePanel/DebugVariableTextViewer.py Fri Oct 06 17:52:34 2017 +0300 @@ -26,7 +26,6 @@ import wx -from DebugVariableItem import DebugVariableItem from DebugVariableViewer import DebugVariableViewer from GraphButton import GraphButton diff -r 6811021e3d94 -r 614396cbffbf controls/DebugVariablePanel/DebugVariableViewer.py --- a/controls/DebugVariablePanel/DebugVariableViewer.py Thu Oct 05 16:46:29 2017 +0300 +++ b/controls/DebugVariablePanel/DebugVariableViewer.py Fri Oct 06 17:52:34 2017 +0300 @@ -25,9 +25,6 @@ from collections import OrderedDict import wx - -import matplotlib -import matplotlib.pyplot from matplotlib.backends.backend_wxagg import _convert_agg_to_wx_bitmap from dialogs.ForceVariableDialog import ForceVariableDialog diff -r 6811021e3d94 -r 614396cbffbf controls/VariablePanel.py --- a/controls/VariablePanel.py Thu Oct 05 16:46:29 2017 +0300 +++ b/controls/VariablePanel.py Fri Oct 06 17:52:34 2017 +0300 @@ -22,7 +22,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import os import re from types import TupleType, StringType, UnicodeType diff -r 6811021e3d94 -r 614396cbffbf dialogs/AboutDialog.py --- a/dialogs/AboutDialog.py Thu Oct 05 16:46:29 2017 +0300 +++ b/dialogs/AboutDialog.py Fri Oct 06 17:52:34 2017 +0300 @@ -31,8 +31,6 @@ """ import os -import sys -import time import wx from wx.lib.agw.hyperlink import HyperLinkCtrl diff -r 6811021e3d94 -r 614396cbffbf dialogs/BrowseLocationsDialog.py --- a/dialogs/BrowseLocationsDialog.py Thu Oct 05 16:46:29 2017 +0300 +++ b/dialogs/BrowseLocationsDialog.py Fri Oct 06 17:52:34 2017 +0300 @@ -23,8 +23,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.# -import os - import wx from plcopen.structures import LOCATIONDATATYPES diff -r 6811021e3d94 -r 614396cbffbf dialogs/DiscoveryDialog.py --- a/dialogs/DiscoveryDialog.py Thu Oct 05 16:46:29 2017 +0300 +++ b/dialogs/DiscoveryDialog.py Fri Oct 06 17:52:34 2017 +0300 @@ -28,8 +28,6 @@ import wx.lib.mixins.listctrl as listmix from zeroconf import ServiceBrowser, Zeroconf -import connectors - service_type = '_PYRO._tcp.local.' diff -r 6811021e3d94 -r 614396cbffbf dialogs/LDPowerRailDialog.py --- a/dialogs/LDPowerRailDialog.py Thu Oct 05 16:46:29 2017 +0300 +++ b/dialogs/LDPowerRailDialog.py Fri Oct 06 17:52:34 2017 +0300 @@ -25,7 +25,7 @@ import wx -from graphics.GraphicCommons import LEFTRAIL, RIGHTRAIL, LD_LINE_SIZE +from graphics.GraphicCommons import LEFTRAIL, RIGHTRAIL from graphics.LD_Objects import LD_PowerRail from BlockPreviewDialog import BlockPreviewDialog diff -r 6811021e3d94 -r 614396cbffbf dialogs/SearchInProjectDialog.py --- a/dialogs/SearchInProjectDialog.py Thu Oct 05 16:46:29 2017 +0300 +++ b/dialogs/SearchInProjectDialog.py Fri Oct 06 17:52:34 2017 +0300 @@ -23,7 +23,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import re import wx from plcopen.plcopen import * from util.TranslationCatalogs import NoTranslate diff -r 6811021e3d94 -r 614396cbffbf doc/conf.py --- a/doc/conf.py Thu Oct 05 16:46:29 2017 +0300 +++ b/doc/conf.py Fri Oct 06 17:52:34 2017 +0300 @@ -11,9 +11,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys -import os - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff -r 6811021e3d94 -r 614396cbffbf docutil/dochtml.py --- a/docutil/dochtml.py Thu Oct 05 16:46:29 2017 +0300 +++ b/docutil/dochtml.py Fri Oct 06 17:52:34 2017 +0300 @@ -22,7 +22,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import os import subprocess import wx import wx.html diff -r 6811021e3d94 -r 614396cbffbf editors/ConfTreeNodeEditor.py --- a/editors/ConfTreeNodeEditor.py Thu Oct 05 16:46:29 2017 +0300 +++ b/editors/ConfTreeNodeEditor.py Fri Oct 06 17:52:34 2017 +0300 @@ -23,7 +23,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import os import types import wx diff -r 6811021e3d94 -r 614396cbffbf editors/LDViewer.py --- a/editors/LDViewer.py Thu Oct 05 16:46:29 2017 +0300 +++ b/editors/LDViewer.py Fri Oct 06 17:52:34 2017 +0300 @@ -22,7 +22,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import time from types import * import wx diff -r 6811021e3d94 -r 614396cbffbf editors/ProjectNodeEditor.py --- a/editors/ProjectNodeEditor.py Thu Oct 05 16:46:29 2017 +0300 +++ b/editors/ProjectNodeEditor.py Fri Oct 06 17:52:34 2017 +0300 @@ -25,7 +25,6 @@ import wx from controls import ProjectPropertiesPanel, VariablePanel -from EditorPanel import EditorPanel from ConfTreeNodeEditor import ConfTreeNodeEditor diff -r 6811021e3d94 -r 614396cbffbf editors/ResourceEditor.py --- a/editors/ResourceEditor.py Thu Oct 05 16:46:29 2017 +0300 +++ b/editors/ResourceEditor.py Fri Oct 06 17:52:34 2017 +0300 @@ -32,7 +32,7 @@ from EditorPanel import EditorPanel from util.BitmapLibrary import GetBitmap from util.TranslationCatalogs import NoTranslate -from plcopen.structures import LOCATIONDATATYPES, TestIdentifier, IEC_KEYWORDS, DefaultType +from plcopen.structures import TestIdentifier, IEC_KEYWORDS # ------------------------------------------------------------------------------- diff -r 6811021e3d94 -r 614396cbffbf editors/TextViewer.py --- a/editors/TextViewer.py Thu Oct 05 16:46:29 2017 +0300 +++ b/editors/TextViewer.py Fri Oct 06 17:52:34 2017 +0300 @@ -29,9 +29,9 @@ import wx.stc from graphics.GraphicCommons import ERROR_HIGHLIGHT, SEARCH_RESULT_HIGHLIGHT, REFRESH_HIGHLIGHT_PERIOD -from plcopen.structures import ST_BLOCK_START_KEYWORDS, ST_BLOCK_END_KEYWORDS, IEC_BLOCK_START_KEYWORDS, IEC_BLOCK_END_KEYWORDS, LOCATIONDATATYPES +from plcopen.structures import ST_BLOCK_START_KEYWORDS, IEC_BLOCK_START_KEYWORDS, LOCATIONDATATYPES from EditorPanel import EditorPanel -from controls.CustomStyledTextCtrl import CustomStyledTextCtrl, faces, GetCursorPos, NAVIGATION_KEYS +from controls.CustomStyledTextCtrl import CustomStyledTextCtrl, faces, GetCursorPos # ------------------------------------------------------------------------------- # Textual programs Viewer class diff -r 6811021e3d94 -r 614396cbffbf editors/Viewer.py --- a/editors/Viewer.py Thu Oct 05 16:46:29 2017 +0300 +++ b/editors/Viewer.py Fri Oct 06 17:52:34 2017 +0300 @@ -22,7 +22,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import re import math from time import time as gettime from types import TupleType diff -r 6811021e3d94 -r 614396cbffbf graphics/GraphicCommons.py --- a/graphics/GraphicCommons.py Thu Oct 05 16:46:29 2017 +0300 +++ b/graphics/GraphicCommons.py Fri Oct 06 17:52:34 2017 +0300 @@ -25,8 +25,6 @@ from math import * from types import * -import datetime -from threading import Lock, Timer import wx from graphics.ToolTipProducer import ToolTipProducer diff -r 6811021e3d94 -r 614396cbffbf plcopen/definitions.py --- a/plcopen/definitions.py Thu Oct 05 16:46:29 2017 +0300 +++ b/plcopen/definitions.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,7 +24,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -from os.path import join, split, realpath +from os.path import join import util.paths as paths from util.TranslationCatalogs import NoTranslate sd = paths.AbsDir(__file__) diff -r 6811021e3d94 -r 614396cbffbf plcopen/plcopen.py --- a/plcopen/plcopen.py Thu Oct 05 16:46:29 2017 +0300 +++ b/plcopen/plcopen.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,7 +24,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from types import * -import os import re from collections import OrderedDict diff -r 6811021e3d94 -r 614396cbffbf py_ext/PythonFileCTNMixin.py --- a/py_ext/PythonFileCTNMixin.py Thu Oct 05 16:46:29 2017 +0300 +++ b/py_ext/PythonFileCTNMixin.py Fri Oct 06 17:52:34 2017 +0300 @@ -25,7 +25,6 @@ import os import re -from lxml import etree import util.paths as paths from xmlclass import GenerateParserFromXSD diff -r 6811021e3d94 -r 614396cbffbf runtime/NevowServer.py --- a/runtime/NevowServer.py Thu Oct 05 16:46:29 2017 +0300 +++ b/runtime/NevowServer.py Fri Oct 06 17:52:34 2017 +0300 @@ -26,9 +26,8 @@ from __future__ import print_function import os import util.paths as paths -from nevow import rend, appserver, inevow, tags, loaders, athena +from nevow import appserver, inevow, tags, loaders, athena from nevow.page import renderer -from twisted.python import util from twisted.internet import reactor xhtml_header = ''' diff -r 6811021e3d94 -r 614396cbffbf runtime/PLCObject.py --- a/runtime/PLCObject.py Thu Oct 05 16:46:29 2017 +0300 +++ b/runtime/PLCObject.py Fri Oct 06 17:52:34 2017 +0300 @@ -25,15 +25,13 @@ from threading import Timer, Thread, Lock, Semaphore, Event import ctypes import os -import commands -import types import sys import traceback from time import time import Pyro.core as pyro -from targets.typemapping import LogLevelsDefault, LogLevelsCount, TypeTranslator, UnpackDebugBuffer +from targets.typemapping import LogLevelsDefault, LogLevelsCount, TypeTranslator if os.name in ("nt", "ce"): diff -r 6811021e3d94 -r 614396cbffbf runtime/WampClient.py --- a/runtime/WampClient.py Thu Oct 05 16:46:29 2017 +0300 +++ b/runtime/WampClient.py Fri Oct 06 17:52:34 2017 +0300 @@ -23,7 +23,6 @@ from __future__ import print_function -import sys import json from autobahn.twisted import wamp diff -r 6811021e3d94 -r 614396cbffbf svgui/pyjs/build.py --- a/svgui/pyjs/build.py Thu Oct 05 16:46:29 2017 +0300 +++ b/svgui/pyjs/build.py Fri Oct 06 17:52:34 2017 +0300 @@ -3,12 +3,10 @@ from __future__ import print_function import sys import shutil -import time import re import os -from os.path import join, dirname, basename, abspath, split, isfile, isdir +from os.path import join, basename, abspath, split, isfile, isdir from hashlib import md5 -from copy import copy from optparse import OptionParser from cStringIO import StringIO diff -r 6811021e3d94 -r 614396cbffbf svgui/pyjs/jsonrpc/django/jsonrpc.py --- a/svgui/pyjs/jsonrpc/django/jsonrpc.py Thu Oct 05 16:46:29 2017 +0300 +++ b/svgui/pyjs/jsonrpc/django/jsonrpc.py Fri Oct 06 17:52:34 2017 +0300 @@ -1,13 +1,8 @@ # jsonrpc.py # original code: http://trac.pyworks.org/pyjamas/wiki/DjangoWithPyJamas # also from: http://www.pimentech.fr/technologies/outils -from datetime import date import datetime -import sys - -from django.utils import simplejson -from django.http import HttpResponse -from django import forms + from django.core.serializers import serialize diff -r 6811021e3d94 -r 614396cbffbf svgui/pyjs/jsonrpc/jsonrpc.py --- a/svgui/pyjs/jsonrpc/jsonrpc.py Thu Oct 05 16:46:29 2017 +0300 +++ b/svgui/pyjs/jsonrpc/jsonrpc.py Fri Oct 06 17:52:34 2017 +0300 @@ -1,4 +1,3 @@ -import types import sys import gluon.contrib.simplejson as simplejson diff -r 6811021e3d94 -r 614396cbffbf svgui/pyjs/lib/pyjslib.py --- a/svgui/pyjs/lib/pyjslib.py Thu Oct 05 16:46:29 2017 +0300 +++ b/svgui/pyjs/lib/pyjslib.py Fri Oct 06 17:52:34 2017 +0300 @@ -233,7 +233,7 @@ # as comment on line 20 says # import sys should be below -import sys # noqa # pylint: disable=C0411 +import sys # noqa # pylint: disable=C0411,W0611 class BaseException: diff -r 6811021e3d94 -r 614396cbffbf svgui/svgui.py --- a/svgui/svgui.py Thu Oct 05 16:46:29 2017 +0300 +++ b/svgui/svgui.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,7 +24,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import os -import sys import shutil import wx diff -r 6811021e3d94 -r 614396cbffbf svgui/svgui_server.py --- a/svgui/svgui_server.py Thu Oct 05 16:46:29 2017 +0300 +++ b/svgui/svgui_server.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,7 +24,7 @@ import os -from nevow import rend, appserver, inevow, tags, loaders, athena +from nevow import tags, loaders import simplejson as json svgfile = '%(svgfile)s' diff -r 6811021e3d94 -r 614396cbffbf targets/toolchain_makefile.py --- a/targets/toolchain_makefile.py Thu Oct 05 16:46:29 2017 +0300 +++ b/targets/toolchain_makefile.py Fri Oct 06 17:52:34 2017 +0300 @@ -26,7 +26,6 @@ import re import operator import hashlib -import time from util.ProcessLogger import ProcessLogger diff -r 6811021e3d94 -r 614396cbffbf tests/tools/check_source.sh --- a/tests/tools/check_source.sh Thu Oct 05 16:46:29 2017 +0300 +++ b/tests/tools/check_source.sh Fri Oct 06 17:52:34 2017 +0300 @@ -217,10 +217,10 @@ 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,W0612 # (unused-variable) Unused variable 'X' + enable=$enable,W0611 # (unused-import), Unused import connectors # enable=$enable,W0403 # relative import # enable=$enable,W0622 # (redefined-builtin) Redefining built-in - # enable=$enable,W0612 # unused-variable # enable=$enable,C1001 # (old-style-class) Old-style class defined. Problem with PyJS # enable= diff -r 6811021e3d94 -r 614396cbffbf tests/tools/conftest.py --- a/tests/tools/conftest.py Thu Oct 05 16:46:29 2017 +0300 +++ b/tests/tools/conftest.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,19 +24,25 @@ import os import sys -import time -import pytest -import xvfbwrapper +# import pytest +# import xvfbwrapper -# append module root directory to sys.path -sys.path.append( - os.path.abspath( - os.path.join( - os.path.dirname(__file__), '..', '..') - ) -) +def init_environment(): + """Append module root directory to sys.path""" + try: + import Beremiz as _Beremiz + except ImportError: + sys.path.append( + os.path.abspath( + os.path.join( + os.path.dirname(__file__), '..', '..') + ) + ) + + +init_environment() # # Something seems to be broken in Beremiz application, diff -r 6811021e3d94 -r 614396cbffbf tests/tools/test_CustomIntCtrl.py --- a/tests/tools/test_CustomIntCtrl.py Thu Oct 05 16:46:29 2017 +0300 +++ b/tests/tools/test_CustomIntCtrl.py Fri Oct 06 17:52:34 2017 +0300 @@ -26,7 +26,6 @@ import time import wx - import conftest import controls.CustomIntCtrl @@ -134,4 +133,5 @@ if __name__ == '__main__': + conftest.init_environment() unittest.main() diff -r 6811021e3d94 -r 614396cbffbf tests/tools/test_application.py --- a/tests/tools/test_application.py Thu Oct 05 16:46:29 2017 +0300 +++ b/tests/tools/test_application.py Fri Oct 06 17:52:34 2017 +0300 @@ -28,7 +28,6 @@ import sys import unittest import time -import traceback import pytest import wx @@ -222,4 +221,5 @@ if __name__ == '__main__': + conftest.init_environment() unittest.main() diff -r 6811021e3d94 -r 614396cbffbf util/ProcessLogger.py --- a/util/ProcessLogger.py Thu Oct 05 16:46:29 2017 +0300 +++ b/util/ProcessLogger.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,7 +24,6 @@ import os import sys -import time import subprocess import ctypes from threading import Timer, Lock, Thread, Semaphore diff -r 6811021e3d94 -r 614396cbffbf util/TranslationCatalogs.py --- a/util/TranslationCatalogs.py Thu Oct 05 16:46:29 2017 +0300 +++ b/util/TranslationCatalogs.py Fri Oct 06 17:52:34 2017 +0300 @@ -24,7 +24,6 @@ import os import __builtin__ -import gettext import wx diff -r 6811021e3d94 -r 614396cbffbf util/misc.py --- a/util/misc.py Thu Oct 05 16:46:29 2017 +0300 +++ b/util/misc.py Fri Oct 06 17:52:34 2017 +0300 @@ -27,8 +27,6 @@ """ import os -import sys -import gettext def CheckPathPerm(path): diff -r 6811021e3d94 -r 614396cbffbf xmlclass/xmlclass.py --- a/xmlclass/xmlclass.py Thu Oct 05 16:46:29 2017 +0300 +++ b/xmlclass/xmlclass.py Fri Oct 06 17:52:34 2017 +0300 @@ -25,12 +25,11 @@ from __future__ import print_function import os -import sys import re import datetime from types import * from xml.dom import minidom -from xml.sax.saxutils import escape, unescape, quoteattr +from xml.sax.saxutils import unescape from new import classobj from collections import OrderedDict