fix isort

Change-Id: I5486e1f9b3143c6bb0804c49c7ca21adb9b84de1
Reviewed-on: https://forge.frm2.tum.de/review/19524
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Tested-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
Enrico Faulhaber
2018-12-03 18:01:29 +01:00
parent 29a5b5c49e
commit 8efd1df92c
45 changed files with 241 additions and 158 deletions

View File

@ -21,10 +21,12 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import division, print_function
import os import os
from os import path from os import path
import markdown import markdown
import codecs
BASE_PATH = path.abspath(path.join(path.dirname(__file__), '..')) BASE_PATH = path.abspath(path.join(path.dirname(__file__), '..'))
DOC_SRC = path.join(BASE_PATH, 'doc') DOC_SRC = path.join(BASE_PATH, 'doc')
@ -55,7 +57,7 @@ for dirpath, dirnames, filenames in os.walk(DOC_SRC):
# treat .md files special # treat .md files special
final_sub_name = path.splitext(sub_name)[0] + '.html' final_sub_name = path.splitext(sub_name)[0] + '.html'
final_name = path.join(DOC_DST, final_sub_name) final_name = path.join(DOC_DST, final_sub_name)
print "Converting", sub_name, "to", final_sub_name print("Converting %s to %s" %(sub_name, final_sub_name))
# transform one file # transform one file
conv.reset() conv.reset()
conv.convertFile(input=full_name, conv.convertFile(input=full_name,

View File

@ -21,17 +21,26 @@
# ***************************************************************************** # *****************************************************************************
"""Define Client side proxies""" """Define Client side proxies"""
from __future__ import print_function from __future__ import division, print_function
import json import json
import socket import socket
from select import select
import threading import threading
from collections import OrderedDict
import time import time
from collections import OrderedDict
from select import select
import mlzlog
import serial import serial
from secop.datatypes import CommandType, EnumType, get_datatype
#from secop.protocol.encoding import ENCODERS
#from secop.protocol.framing import FRAMERS
#from secop.protocol.messages import *
from secop.errors import EXCEPTIONS
from secop.lib import formatException, formatExtendedStack, mkthread
from secop.lib.parsing import format_time, parse_time
try: try:
# py3 # py3
import queue import queue
@ -39,15 +48,7 @@ except ImportError:
# py2 # py2
import Queue as queue import Queue as queue
import mlzlog
from secop.datatypes import get_datatype, EnumType, CommandType
from secop.lib import mkthread, formatException, formatExtendedStack
from secop.lib.parsing import parse_time, format_time
#from secop.protocol.encoding import ENCODERS
#from secop.protocol.framing import FRAMERS
#from secop.protocol.messages import *
from secop.errors import EXCEPTIONS
class TCPConnection(object): class TCPConnection(object):

View File

@ -21,7 +21,13 @@
# ***************************************************************************** # *****************************************************************************
"""Define validated data types.""" """Define validated data types."""
from __future__ import print_function from __future__ import division, print_function
from base64 import b64decode, b64encode
from secop.errors import ProgrammingError, ProtocolError
from secop.lib.enum import Enum
from secop.parse import Parser
try: try:
# py2 # py2
@ -30,11 +36,7 @@ except NameError:
# py3 # py3
unicode = str # pylint: disable=redefined-builtin unicode = str # pylint: disable=redefined-builtin
from base64 import b64encode, b64decode
from secop.lib.enum import Enum
from secop.errors import ProgrammingError, ProtocolError
from secop.parse import Parser
Parser = Parser() Parser = Parser()

View File

@ -21,6 +21,8 @@
# ***************************************************************************** # *****************************************************************************
"""Define (internal) SECoP Errors""" """Define (internal) SECoP Errors"""
from __future__ import division, print_function
class SECoPError(RuntimeError): class SECoPError(RuntimeError):

View File

@ -21,11 +21,13 @@
# ***************************************************************************** # *****************************************************************************
"""Define Mixin Features for real Modules implemented in the server""" """Define Mixin Features for real Modules implemented in the server"""
from __future__ import print_function from __future__ import division, print_function
from secop.datatypes import EnumType, TupleOf, StringType, FloatRange, StructOf, ArrayOf, BoolType from secop.datatypes import (ArrayOf, BoolType, EnumType, FloatRange,
from secop.modules import Parameter, Command StringType, StructOf, TupleOf)
from secop.metaclass import ModuleMeta, add_metaclass from secop.metaclass import ModuleMeta, add_metaclass
from secop.modules import Command, Parameter
@add_metaclass(ModuleMeta) @add_metaclass(ModuleMeta)
class Feature(object): class Feature(object):

View File

@ -21,19 +21,17 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import print_function from __future__ import division, print_function
import sys import sys
from secop.gui.qt import QMainWindow, QInputDialog, QTreeWidgetItem, QMessageBox, \
pyqtSlot, QObject, pyqtSignal
from secop.gui.util import loadUi
from secop.gui.nodectrl import NodeCtrl
from secop.gui.modulectrl import ModuleCtrl
from secop.gui.paramview import ParameterView
from secop.client.baseclient import Client as SECNode from secop.client.baseclient import Client as SECNode
from secop.gui.modulectrl import ModuleCtrl
from secop.gui.nodectrl import NodeCtrl
from secop.gui.paramview import ParameterView
from secop.gui.qt import (QInputDialog, QMainWindow, QMessageBox, QObject,
QTreeWidgetItem, pyqtSignal, pyqtSlot)
from secop.gui.util import loadUi
ITEM_TYPE_NODE = QTreeWidgetItem.UserType + 1 ITEM_TYPE_NODE = QTreeWidgetItem.UserType + 1
ITEM_TYPE_GROUP = QTreeWidgetItem.UserType + 2 ITEM_TYPE_GROUP = QTreeWidgetItem.UserType + 2

View File

@ -22,12 +22,12 @@
# ***************************************************************************** # *****************************************************************************
from __future__ import division, print_function
from os import path from os import path
from secop.gui.qt import Qt, QColor, QWidget, QSize, \ from secop.gui.qt import (QBrush, QColor, QPainter, QPen, QPointF, QPolygonF,
QBrush, QPainter, QPolygonF, QPointF, QPen, QRectF QRectF, QSize, Qt, QWidget)
_magenta = QBrush(QColor('#A12F86')) _magenta = QBrush(QColor('#A12F86'))
_yellow = QBrush(QColor('yellow')) _yellow = QBrush(QColor('yellow'))

View File

@ -22,7 +22,13 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import print_function from __future__ import division, print_function
from secop.gui.params import ParameterView
from secop.gui.qt import QCheckBox, QDialog, QLabel, QMessageBox, QPushButton, \
QSizePolicy, QWidget
from secop.gui.util import loadUi
from secop.gui.valuewidgets import get_widget
try: try:
# py2 # py2
@ -31,15 +37,12 @@ except NameError:
# py3 # py3
unicode = str # pylint: disable=redefined-builtin unicode = str # pylint: disable=redefined-builtin
from secop.gui.util import loadUi
from secop.gui.params import ParameterView
#from secop.datatypes import ... #from secop.datatypes import ...
from secop.gui.qt import QDialog, QLabel, QCheckBox, QWidget, QMessageBox, \
QPushButton, QSizePolicy
from secop.gui.valuewidgets import get_widget
class CommandDialog(QDialog): class CommandDialog(QDialog):

View File

@ -21,7 +21,17 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import print_function, division from __future__ import division, print_function
import json
import pprint
from time import sleep
from secop.datatypes import EnumType, StringType
from secop.errors import SECoPError
from secop.gui.qt import (QFont, QFontMetrics, QLabel, QMessageBox,
QTextCursor, QWidget, pyqtSlot, toHtmlEscaped)
from secop.gui.util import loadUi
try: try:
# py2 # py2
@ -29,16 +39,8 @@ try:
except NameError: except NameError:
unicode = str # pylint: disable=redefined-builtin unicode = str # pylint: disable=redefined-builtin
import pprint
import json
from time import sleep
from secop.gui.qt import QWidget, QTextCursor, QFont, QFontMetrics, QLabel, \
QMessageBox, pyqtSlot, toHtmlEscaped
from secop.gui.util import loadUi
from secop.errors import SECoPError
from secop.datatypes import StringType, EnumType
class NodeCtrl(QWidget): class NodeCtrl(QWidget):

View File

@ -33,12 +33,13 @@ from secop.gui.qt import QWidget, QLabel, QPushButton as QButton, QLineEdit, \
QMessageBox, QCheckBox, QSizePolicy, Qt, pyqtSignal, pyqtSlot QMessageBox, QCheckBox, QSizePolicy, Qt, pyqtSignal, pyqtSlot
from secop.gui.util import loadUi from secop.gui.util import loadUi
from secop.datatypes import EnumType from secop.datatypes import EnumType, FloatRange, IntRange
from secop.lib import formatExtendedStack from secop.lib import formatExtendedStack
class ParameterWidget(QWidget): class ParameterWidget(QWidget):
setRequested = pyqtSignal(str, str, object) # module, parameter, target setRequested = pyqtSignal(str, str, object) # module, parameter, target
plotRequested = pyqtSignal(str, str) # module, parameter
cmdRequested = pyqtSignal(str, str, list) # module, command, args cmdRequested = pyqtSignal(str, str, list) # module, command, args
def __init__(self, def __init__(self,

View File

@ -21,6 +21,8 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import division, print_function
try: try:
# py2 # py2
unicode(u'') unicode(u'')
@ -28,8 +30,7 @@ except NameError:
# py3 # py3
unicode = str # pylint: disable=redefined-builtin unicode = str # pylint: disable=redefined-builtin
from secop.gui.qt import QWidget, QLabel, QSizePolicy from secop.gui.qt import QLabel, QSizePolicy, QWidget
from secop.gui.util import loadUi from secop.gui.util import loadUi

View File

@ -22,7 +22,7 @@
"""Import needed stuff from PyQt4/PyQt5""" """Import needed stuff from PyQt4/PyQt5"""
# pylint: disable=unused-import # pylint: disable=unused-import
from __future__ import print_function from __future__ import division, print_function
import sys import sys

View File

@ -21,6 +21,8 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import division, print_function
from os import path from os import path
from secop.gui.qt import uic from secop.gui.qt import uic

View File

@ -21,18 +21,15 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import print_function from __future__ import division, print_function
from secop.datatypes import FloatRange, IntRange, StringType, BLOBType, \
EnumType, BoolType, TupleOf, StructOf, ArrayOf
from secop.gui.qt import QDialog, QLabel, QLineEdit,\
QGroupBox, QSpinBox, QDoubleSpinBox, QComboBox, QCheckBox, \
QVBoxLayout, QGridLayout, QFrame
from secop.datatypes import (ArrayOf, BLOBType, BoolType, EnumType, FloatRange,
IntRange, StringType, StructOf, TupleOf)
from secop.gui.qt import (QCheckBox, QComboBox, QDialog, QDoubleSpinBox,
QFrame, QGridLayout, QGroupBox, QLabel, QLineEdit,
QSpinBox, QVBoxLayout)
from secop.gui.util import loadUi from secop.gui.util import loadUi
# XXX: implement live validators !!!! # XXX: implement live validators !!!!
class StringWidget(QLineEdit): class StringWidget(QLineEdit):

View File

@ -22,6 +22,8 @@
# ***************************************************************************** # *****************************************************************************
"""Enum class""" """Enum class"""
from __future__ import division, print_function
__ALL__ = ['Enum'] __ALL__ = ['Enum']
try: try:

View File

@ -21,9 +21,11 @@
# ***************************************************************************** # *****************************************************************************
"""Define parsing helpers""" """Define parsing helpers"""
from __future__ import division, print_function
import re import re
import time import time
from datetime import tzinfo, timedelta, datetime from datetime import datetime, timedelta, tzinfo
# format_time and parse_time could be simplified with external dateutil lib # format_time and parse_time could be simplified with external dateutil lib
# http://stackoverflow.com/a/15228038 # http://stackoverflow.com/a/15228038

View File

@ -20,8 +20,11 @@
# #
# ***************************************************************************** # *****************************************************************************
"""Define pidfile helpers""" """Define pidfile helpers"""
import os from __future__ import division, print_function
import atexit import atexit
import os
import psutil import psutil

View File

@ -23,10 +23,12 @@
"""Utilities for modules that require sequenced actions on value change.""" """Utilities for modules that require sequenced actions on value change."""
from __future__ import division, print_function
from time import sleep from time import sleep
from secop.lib import mkthread
from secop.errors import IsBusyError from secop.errors import IsBusyError
from secop.lib import mkthread
class Namespace(object): class Namespace(object):

View File

@ -21,9 +21,15 @@
# ***************************************************************************** # *****************************************************************************
"""Define Metaclass for Modules/Features""" """Define Metaclass for Modules/Features"""
from __future__ import print_function from __future__ import division, print_function
import time
from collections import OrderedDict from collections import OrderedDict
from secop.datatypes import EnumType
from secop.errors import ProgrammingError
from secop.params import Command, Override, Parameter
try: try:
# pylint: disable=unused-import # pylint: disable=unused-import
from six import add_metaclass # for py2/3 compat from six import add_metaclass # for py2/3 compat
@ -44,11 +50,7 @@ except ImportError:
return metaclass(cls.__name__, cls.__bases__, orig_vars) return metaclass(cls.__name__, cls.__bases__, orig_vars)
return wrapper return wrapper
import time
from secop.errors import ProgrammingError
from secop.datatypes import EnumType
from secop.params import Parameter, Override, Command
EVENT_ONLY_ON_CHANGED_VALUES = True EVENT_ONLY_ON_CHANGED_VALUES = True

View File

@ -21,22 +21,26 @@
# ***************************************************************************** # *****************************************************************************
"""Define Baseclasses for real Modules implemented in the server""" """Define Baseclasses for real Modules implemented in the server"""
from __future__ import print_function from __future__ import division, print_function
import sys
import time
from secop.datatypes import (EnumType, FloatRange, StringType, TupleOf,
get_datatype)
from secop.errors import ConfigError
from secop.lib import (formatException, formatExtendedStack, mkthread,
unset_value)
from secop.lib.enum import Enum
from secop.metaclass import ModuleMeta, add_metaclass
from secop.params import Command, Override, Parameter
# XXX: connect with 'protocol'-Modules. # XXX: connect with 'protocol'-Modules.
# Idea: every Module defined herein is also a 'protocol'-Module, # Idea: every Module defined herein is also a 'protocol'-Module,
# all others MUST derive from those, the 'interface'-class is still derived # all others MUST derive from those, the 'interface'-class is still derived
# from these base classes (how to do this?) # from these base classes (how to do this?)
import sys
import time
from secop.lib import formatExtendedStack, mkthread, unset_value, formatException
from secop.lib.enum import Enum
from secop.errors import ConfigError
from secop.datatypes import EnumType, TupleOf, StringType, FloatRange, get_datatype
from secop.metaclass import add_metaclass, ModuleMeta
from secop.params import Command, Parameter, Override
@add_metaclass(ModuleMeta) @add_metaclass(ModuleMeta)

View File

@ -21,9 +21,11 @@
# ***************************************************************************** # *****************************************************************************
"""Define classes for Parameters/Commands and Overriding them""" """Define classes for Parameters/Commands and Overriding them"""
from secop.lib import unset_value from __future__ import division, print_function
from secop.datatypes import CommandType, DataType
from secop.errors import ProgrammingError from secop.errors import ProgrammingError
from secop.datatypes import DataType, CommandType from secop.lib import unset_value
EVENT_ONLY_ON_CHANGED_VALUES = False EVENT_ONLY_ON_CHANGED_VALUES = False

View File

@ -36,7 +36,7 @@ text -> string
further convertions are done by the validator of the datatype.... further convertions are done by the validator of the datatype....
""" """
from __future__ import print_function from __future__ import division, print_function
from collections import OrderedDict from collections import OrderedDict

View File

@ -21,6 +21,8 @@
# ***************************************************************************** # *****************************************************************************
"""Pathes. how to find what and where...""" """Pathes. how to find what and where..."""
from __future__ import division, print_function
import sys import sys
from os import path from os import path

View File

@ -36,20 +36,19 @@ Interface to the modules:
- remove_module(modulename_or_obj): removes the module (during shutdown) - remove_module(modulename_or_obj): removes the module (during shutdown)
""" """
from __future__ import print_function from __future__ import division, print_function
from time import time as currenttime
import threading import threading
from time import time as currenttime
from secop.protocol.messages import EVENTREPLY, IDENTREQUEST, IDENTREPLY, \ from secop.errors import SECoPServerError as InternalError
ENABLEEVENTSREPLY, DESCRIPTIONREPLY, WRITEREPLY, COMMANDREPLY, \ from secop.errors import (BadValueError, NoSuchCommandError, NoSuchModuleError,
DISABLEEVENTSREPLY, HEARTBEATREPLY NoSuchParameterError, ProtocolError, ReadOnlyError)
from secop.errors import NoSuchModuleError, NoSuchCommandError, \
NoSuchParameterError, BadValueError, ReadOnlyError, \
ProtocolError, SECoPServerError as InternalError
from secop.params import Parameter from secop.params import Parameter
from secop.protocol.messages import (COMMANDREPLY, DESCRIPTIONREPLY,
DISABLEEVENTSREPLY, ENABLEEVENTSREPLY,
EVENTREPLY, HEARTBEATREPLY, IDENTREPLY,
IDENTREQUEST, WRITEREPLY)
try: try:
unicode('a') unicode('a')

View File

@ -19,21 +19,23 @@
# #
# ***************************************************************************** # *****************************************************************************
"""provides tcp interface to the SECoP Server""" """provides tcp interface to the SECoP Server"""
from __future__ import print_function from __future__ import division, print_function
import sys
import socket
import collections import collections
import socket
import sys
from secop.errors import SECoPError
from secop.lib import (formatException, formatExtendedStack,
formatExtendedTraceback)
from secop.protocol.interface import decode_msg, encode_msg_frame, get_msg
from secop.protocol.messages import HELPREPLY, HELPREQUEST, HelpMessage
try: try:
import socketserver # py3 import socketserver # py3
except ImportError: except ImportError:
import SocketServer as socketserver # py2 import SocketServer as socketserver # py2
from secop.lib import formatExtendedStack, formatException, formatExtendedTraceback
from secop.protocol.messages import HELPREQUEST, HELPREPLY, HelpMessage
from secop.errors import SECoPError
from secop.protocol.interface import encode_msg_frame, get_msg, decode_msg
DEF_PORT = 10767 DEF_PORT = 10767

View File

@ -21,6 +21,8 @@
# ***************************************************************************** # *****************************************************************************
"""provide a zmq server""" """provide a zmq server"""
from __future__ import division, print_function
# tbd. # tbd.
# use zmq frames?? # use zmq frames??

View File

@ -20,7 +20,7 @@
# #
# ***************************************************************************** # *****************************************************************************
"""Define SECoP Messages""" """Define SECoP Messages"""
from __future__ import print_function from __future__ import division, print_function
# allowed actions: # allowed actions:

View File

@ -21,14 +21,19 @@
# #
# ***************************************************************************** # *****************************************************************************
"""Define helpers""" """Define helpers"""
from __future__ import print_function from __future__ import division, print_function
import os
import ast import ast
import time import os
import threading import threading
import time
from collections import OrderedDict from collections import OrderedDict
from daemon import DaemonContext
from secop.errors import ConfigError
from secop.lib import formatException, get_class, getGeneralConfig
try: try:
import configparser # py3 import configparser # py3
except ImportError: except ImportError:
@ -39,15 +44,12 @@ try:
except ImportError: except ImportError:
from Queue import Queue # py 2 from Queue import Queue # py 2
from daemon import DaemonContext
try: try:
import daemon.pidlockfile as pidlockfile import daemon.pidlockfile as pidlockfile
except ImportError: except ImportError:
import daemon.pidfile as pidlockfile import daemon.pidfile as pidlockfile
from secop.lib import get_class, formatException, getGeneralConfig
from secop.errors import ConfigError

View File

@ -21,12 +21,14 @@
# ***************************************************************************** # *****************************************************************************
"""Define Simulation classes""" """Define Simulation classes"""
from __future__ import division, print_function
import random import random
from time import sleep from time import sleep
from secop.modules import Module, Readable, Writable, Drivable, Parameter
from secop.lib import mkthread
from secop.datatypes import FloatRange from secop.datatypes import FloatRange
from secop.lib import mkthread
from secop.modules import Drivable, Module, Parameter, Readable, Writable
class SimBase(object): class SimBase(object):

View File

@ -23,10 +23,10 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import print_function from __future__ import division, print_function
import os.path import os.path
from subprocess import Popen, PIPE from subprocess import PIPE, Popen
__all__ = ['get_version'] __all__ = ['get_version']

View File

@ -20,13 +20,15 @@
# ***************************************************************************** # *****************************************************************************
"""playing implementation of a (simple) simulated cryostat""" """playing implementation of a (simple) simulated cryostat"""
from math import atan from __future__ import division, print_function
import time
import random
from secop.modules import Drivable, Command, Parameter import random
from secop.datatypes import FloatRange, EnumType, TupleOf import time
from math import atan
from secop.datatypes import EnumType, FloatRange, TupleOf
from secop.lib import clamp, mkthread from secop.lib import clamp, mkthread
from secop.modules import Command, Drivable, Parameter
class CryoBase(Drivable): class CryoBase(Drivable):

View File

@ -20,13 +20,16 @@
# ***************************************************************************** # *****************************************************************************
"""testing devices""" """testing devices"""
import time from __future__ import division, print_function
import random import random
import threading import threading
import time
from secop.datatypes import (ArrayOf, BoolType, EnumType, FloatRange, IntRange,
StringType, StructOf, TupleOf)
from secop.lib.enum import Enum from secop.lib.enum import Enum
from secop.modules import Readable, Drivable, Parameter, Override from secop.modules import Drivable, Override, Parameter, Readable
from secop.datatypes import EnumType, FloatRange, IntRange, ArrayOf, StringType, TupleOf, StructOf, BoolType
class Switch(Drivable): class Switch(Drivable):

View File

@ -20,6 +20,8 @@
# ***************************************************************************** # *****************************************************************************
"""testing devices""" """testing devices"""
from __future__ import division, print_function
try: try:
# py2 # py2
unicode unicode
@ -29,8 +31,8 @@ except NameError:
import random import random
from secop.modules import Readable, Drivable, Communicator, Parameter
from secop.datatypes import FloatRange, StringType from secop.datatypes import FloatRange, StringType
from secop.modules import Communicator, Drivable, Parameter, Readable
class LN2(Readable): class LN2(Readable):

View File

@ -20,10 +20,10 @@
# #
# ***************************************************************************** # *****************************************************************************
from __future__ import absolute_import from __future__ import absolute_import, division, print_function
from secop.datatypes import EnumType, FloatRange, StringType from secop.datatypes import EnumType, FloatRange, StringType
from secop.modules import Readable, Drivable, Parameter from secop.modules import Drivable, Parameter, Readable
try: try:
from pvaccess import Channel # import EPIVSv4 functionallity, PV access from pvaccess import Channel # import EPIVSv4 functionallity, PV access

View File

@ -25,12 +25,14 @@
# partially borrowed from nicos # partially borrowed from nicos
from __future__ import division, print_function
import math import math
from secop.datatypes import ArrayOf, FloatRange, StringType, StructOf, TupleOf
from secop.errors import ConfigError, DisabledError
from secop.lib.sequence import SequencerMixin, Step from secop.lib.sequence import SequencerMixin, Step
from secop.datatypes import StringType, TupleOf, FloatRange, ArrayOf, StructOf from secop.modules import Drivable, Parameter
from secop.errors import DisabledError, ConfigError
from secop.modules import Parameter, Drivable
class GarfieldMagnet(SequencerMixin, Drivable): class GarfieldMagnet(SequencerMixin, Drivable):

View File

@ -27,21 +27,23 @@
Here we support devices which fulfill the official Here we support devices which fulfill the official
MLZ TANGO interface for the respective device classes. MLZ TANGO interface for the respective device classes.
""" """
from __future__ import division from __future__ import division, print_function
import re import re
from time import sleep, time as currenttime
import threading import threading
from time import time as currenttime
from time import sleep
import PyTango import PyTango
from secop.lib import lazy_property
#from secop.parse import Parser #from secop.parse import Parser
from secop.datatypes import IntRange, FloatRange, StringType, TupleOf, \ from secop.datatypes import (ArrayOf, EnumType, FloatRange, IntRange,
ArrayOf, EnumType StringType, TupleOf)
from secop.errors import ConfigError, ProgrammingError, CommunicationFailedError, \ from secop.errors import (CommunicationFailedError, ConfigError, HardwareError,
HardwareError ProgrammingError)
from secop.modules import Parameter, Command, Override, Module, Readable, Drivable from secop.lib import lazy_property
from secop.modules import (Command, Drivable, Module, Override, Parameter,
Readable)
##### #####

View File

@ -22,13 +22,15 @@
# #
# ***************************************************************************** # *****************************************************************************
from setuptools import setup, find_packages from __future__ import division, print_function
from os import path, listdir
from glob import glob from glob import glob
from os import listdir, path
from setuptools import find_packages, setup
import secop.version import secop.version
scripts = glob(path.join('bin', 'secop-*')) scripts = glob(path.join('bin', 'secop-*'))
uidir = path.join(path.dirname(__file__), 'secop', 'gui', 'ui') uidir = path.join(path.dirname(__file__), 'secop', 'gui', 'ui')

View File

@ -1,4 +1,6 @@
# content of conftest.py # content of conftest.py
from __future__ import division, print_function
import pytest import pytest
@ -15,5 +17,6 @@ def constants():
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
# pylint: disable=redefined-builtin
def globals(): def globals():
return dict() return dict()

View File

@ -20,18 +20,21 @@
# #
# ***************************************************************************** # *****************************************************************************
"""test base client.""" """test base client."""
from __future__ import print_function from __future__ import division, print_function
import sys import sys
from os import path
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
from collections import OrderedDict from collections import OrderedDict
from os import path
import pytest import pytest
from secop.client.baseclient import Client from secop.client.baseclient import Client
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
# define Test-only connection object # define Test-only connection object

View File

@ -21,17 +21,22 @@
# ***************************************************************************** # *****************************************************************************
"""test data types.""" """test data types."""
from __future__ import division, print_function
import sys import sys
from os import path from os import path
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
# no fixtures needed # no fixtures needed
import pytest import pytest
from secop.datatypes import (ArrayOf, BLOBType, BoolType, DataType, EnumType,
FloatRange, IntRange, ProgrammingError,
StringType, StructOf, TupleOf, get_datatype)
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
from secop.datatypes import DataType, FloatRange, IntRange, \
EnumType, BLOBType, StringType, BoolType, ArrayOf, TupleOf, StructOf, \
get_datatype, ProgrammingError
def test_DataType(): def test_DataType():

View File

@ -21,15 +21,20 @@
# ***************************************************************************** # *****************************************************************************
"""test Enum type.""" """test Enum type."""
from __future__ import division, print_function
import sys import sys
from os import path from os import path
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
# no fixtures needed # no fixtures needed
import pytest import pytest
from secop.lib.enum import Enum, EnumMember
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
from secop.lib.enum import EnumMember, Enum
def test_EnumMember(): def test_EnumMember():

View File

@ -20,25 +20,28 @@
# #
# ***************************************************************************** # *****************************************************************************
"""test data types.""" """test data types."""
from __future__ import print_function from __future__ import division, print_function
import sys import sys
from os import path from os import path
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
# no fixtures needed # no fixtures needed
import pytest import pytest
from secop.datatypes import BoolType, EnumType
from secop.metaclass import ModuleMeta
from secop.modules import Communicator, Drivable, Module, Readable, Writable
from secop.params import Command, Override, Parameter
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
try: try:
import Queue as queue import Queue as queue
except ImportError: except ImportError:
import queue as queue import queue as queue
from secop.datatypes import BoolType, EnumType
from secop.metaclass import ModuleMeta
from secop.params import Command, Parameter, Override
from secop.modules import Module, Readable, Writable, Drivable, Communicator
def test_Communicator(): def test_Communicator():

View File

@ -21,17 +21,22 @@
# ***************************************************************************** # *****************************************************************************
"""test data types.""" """test data types."""
from __future__ import division, print_function
import sys import sys
from os import path from os import path
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
# no fixtures needed # no fixtures needed
import pytest import pytest
from secop.datatypes import BoolType from secop.datatypes import BoolType
from secop.params import Command, Override, Parameter
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
from secop.params import Command, Parameter, Override
def test_Command(): def test_Command():

View File

@ -21,16 +21,21 @@
# ***************************************************************************** # *****************************************************************************
"""test data types.""" """test data types."""
import sys from __future__ import division, print_function
from os import path
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
import sys
from collections import OrderedDict from collections import OrderedDict
from os import path
import pytest import pytest
from secop.parse import Parser from secop.parse import Parser
sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), '..')))
# pylint: disable=redefined-outer-name # pylint: disable=redefined-outer-name
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def parser(): def parser():

View File

@ -1,3 +1,5 @@
from __future__ import division, print_function
def test_assert(): def test_assert():
assert 1 assert 1