summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/auto_rst4api.py64
-rw-r--r--doc/source/sphinxext/taurusextension.py3
-rw-r--r--lib/taurus/__init__.py3
-rw-r--r--lib/taurus/cli/__init__.py1
-rw-r--r--lib/taurus/cli/alt.py1
-rw-r--r--lib/taurus/cli/common.py1
-rw-r--r--lib/taurus/cli/test/__init__.py3
-rw-r--r--lib/taurus/console/__init__.py3
-rw-r--r--lib/taurus/console/enums.py3
-rw-r--r--lib/taurus/console/list.py3
-rw-r--r--lib/taurus/console/table.py3
-rw-r--r--lib/taurus/console/util/__init__.py3
-rw-r--r--lib/taurus/core/__init__.py3
-rw-r--r--lib/taurus/core/epics/epicsattribute.py8
-rw-r--r--lib/taurus/core/epics/epicsfactory.py25
-rw-r--r--lib/taurus/core/epics/test/test_epicsattribute.py3
-rw-r--r--lib/taurus/core/epics/test/test_epicsvalidator.py3
-rw-r--r--lib/taurus/core/evaluation/evalattribute.py58
-rw-r--r--lib/taurus/core/evaluation/evalfactory.py28
-rw-r--r--lib/taurus/core/evaluation/evalvalidator.py69
-rw-r--r--lib/taurus/core/evaluation/test/test_evalattribute.py3
-rw-r--r--lib/taurus/core/evaluation/test/test_evalfactory.py3
-rw-r--r--lib/taurus/core/evaluation/test/test_evalvalidator.py3
-rw-r--r--lib/taurus/core/init_bkcomp.py3
-rw-r--r--lib/taurus/core/init_lightweight.py3
-rw-r--r--lib/taurus/core/resource/__init__.py1
-rw-r--r--lib/taurus/core/resource/resfactory.py66
-rw-r--r--lib/taurus/core/resource/resvalidator.py6
-rw-r--r--lib/taurus/core/resource/test/test_resfactory.py3
-rw-r--r--lib/taurus/core/resource/test/test_resvalidator.py6
-rw-r--r--lib/taurus/core/tango/enums.py4
-rw-r--r--lib/taurus/core/tango/img/__init__.py3
-rw-r--r--lib/taurus/core/tango/img/img.py6
-rw-r--r--lib/taurus/core/tango/starter.py16
-rw-r--r--lib/taurus/core/tango/tangoattribute.py52
-rw-r--r--lib/taurus/core/tango/tangoconfiguration.py6
-rw-r--r--lib/taurus/core/tango/tangodatabase.py71
-rw-r--r--lib/taurus/core/tango/tangodevice.py24
-rw-r--r--lib/taurus/core/tango/tangofactory.py126
-rw-r--r--lib/taurus/core/tango/tangovalidator.py3
-rw-r--r--lib/taurus/core/tango/test/nodb.py4
-rwxr-xr-xlib/taurus/core/tango/test/res/TangoSchemeTest.py2
-rw-r--r--lib/taurus/core/tango/test/test_tangoattribute.py3
-rw-r--r--lib/taurus/core/tango/test/test_tangofactory.py3
-rw-r--r--lib/taurus/core/tango/test/test_tangovalidator.py3
-rw-r--r--lib/taurus/core/tango/test/tgtestds.py7
-rw-r--r--lib/taurus/core/tango/util/__init__.py3
-rw-r--r--lib/taurus/core/tango/util/formatter.py4
-rw-r--r--lib/taurus/core/tango/util/tango_taurus.py3
-rw-r--r--lib/taurus/core/taurusattribute.py16
-rw-r--r--lib/taurus/core/taurusauthority.py3
-rw-r--r--lib/taurus/core/taurusconfiguration.py3
-rw-r--r--lib/taurus/core/taurusdatabase.py3
-rw-r--r--lib/taurus/core/taurusdevice.py12
-rw-r--r--lib/taurus/core/taurusexception.py3
-rw-r--r--lib/taurus/core/taurusfactory.py60
-rw-r--r--lib/taurus/core/taurushelper.py70
-rw-r--r--lib/taurus/core/tauruslistener.py3
-rw-r--r--lib/taurus/core/taurusmanager.py112
-rw-r--r--lib/taurus/core/taurusmodel.py22
-rw-r--r--lib/taurus/core/taurusoperation.py3
-rw-r--r--lib/taurus/core/tauruspollingtimer.py37
-rw-r--r--lib/taurus/core/taurusvalidator.py9
-rw-r--r--lib/taurus/core/test/basevalidator.py3
-rw-r--r--lib/taurus/core/test/modelequality.py9
-rw-r--r--lib/taurus/core/test/test_taurushelper.py3
-rw-r--r--lib/taurus/core/util/argparse/taurusargparse.py34
-rw-r--r--lib/taurus/core/util/codecs.py261
-rw-r--r--lib/taurus/core/util/colors.py6
-rw-r--r--lib/taurus/core/util/console.py9
-rw-r--r--lib/taurus/core/util/containers.py125
-rw-r--r--lib/taurus/core/util/decorator/decorator.py1
-rw-r--r--lib/taurus/core/util/decorator/typecheck.py6
-rw-r--r--lib/taurus/core/util/enumeration.py15
-rw-r--r--lib/taurus/core/util/event.py107
-rw-r--r--lib/taurus/core/util/eventfilters.py26
-rw-r--r--lib/taurus/core/util/excepthook.py10
-rw-r--r--lib/taurus/core/util/init_bkcomp.py7
-rw-r--r--lib/taurus/core/util/init_lightweight.py7
-rw-r--r--lib/taurus/core/util/lock.py3
-rw-r--r--lib/taurus/core/util/log.py180
-rw-r--r--lib/taurus/core/util/object.py6
-rw-r--r--lib/taurus/core/util/parse_args.py6
-rw-r--r--lib/taurus/core/util/plugin.py36
-rw-r--r--lib/taurus/core/util/prop.py3
-rw-r--r--lib/taurus/core/util/property_parser.py15
-rw-r--r--lib/taurus/core/util/propertyfile.py15
-rw-r--r--lib/taurus/core/util/remotelogmonitor.py3
-rw-r--r--lib/taurus/core/util/report/__init__.py3
-rw-r--r--lib/taurus/core/util/report/report.py3
-rw-r--r--lib/taurus/core/util/singleton.py3
-rw-r--r--lib/taurus/core/util/sourcecode.py3
-rw-r--r--lib/taurus/core/util/tablepprint.py23
-rw-r--r--lib/taurus/core/util/tb.py3
-rw-r--r--lib/taurus/core/util/test/test_codecs.py3
-rw-r--r--lib/taurus/core/util/test/test_timer.py6
-rw-r--r--lib/taurus/core/util/threadpool.py3
-rw-r--r--lib/taurus/core/util/timer.py3
-rw-r--r--lib/taurus/core/util/user.py6
-rw-r--r--lib/taurus/core/util/whichexecutable.py16
-rw-r--r--lib/taurus/core/util/wrap.py9
-rw-r--r--lib/taurus/external/qt/Qt.py3
-rw-r--r--lib/taurus/external/qt/QtHelp.py3
-rw-r--r--lib/taurus/external/qt/QtSvg.py3
-rw-r--r--lib/taurus/external/qt/QtWebKit.py3
-rw-r--r--lib/taurus/external/qt/__init__.py3
-rw-r--r--lib/taurus/qt/__init__.py3
-rw-r--r--lib/taurus/qt/qtcore/__init__.py3
-rw-r--r--lib/taurus/qt/qtcore/communication/__init__.py3
-rw-r--r--lib/taurus/qt/qtcore/communication/communication.py138
-rw-r--r--lib/taurus/qt/qtcore/configuration/__init__.py3
-rw-r--r--lib/taurus/qt/qtcore/configuration/configuration.py146
-rw-r--r--lib/taurus/qt/qtcore/mimetypes/__init__.py3
-rw-r--r--lib/taurus/qt/qtcore/mimetypes/mimetypes.py3
-rw-r--r--lib/taurus/qt/qtcore/model/__init__.py1
-rw-r--r--lib/taurus/qt/qtcore/model/taurusdatabasemodel.py27
-rw-r--r--lib/taurus/qt/qtcore/model/taurusmodel.py39
-rw-r--r--lib/taurus/qt/qtcore/tango/__init__.py3
-rw-r--r--lib/taurus/qt/qtcore/taurusqlistener.py54
-rw-r--r--lib/taurus/qt/qtcore/util/__init__.py3
-rw-r--r--lib/taurus/qt/qtcore/util/emitter.py12
-rw-r--r--lib/taurus/qt/qtcore/util/properties.py1
-rw-r--r--lib/taurus/qt/qtcore/util/signal.py7
-rw-r--r--lib/taurus/qt/qtcore/util/tauruslog.py3
-rw-r--r--lib/taurus/qt/qtdesigner/__init__.py3
-rw-r--r--lib/taurus/qt/qtdesigner/taurusplugin/__init__.py3
-rw-r--r--lib/taurus/qt/qtdesigner/taurusplugin/taurusplugin.py9
-rw-r--r--lib/taurus/qt/qtgui/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/application/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/application/taurusapplication.py35
-rw-r--r--lib/taurus/qt/qtgui/base/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/base/taurusbase.py497
-rw-r--r--lib/taurus/qt/qtgui/base/tauruscontroller.py8
-rw-r--r--lib/taurus/qt/qtgui/base/test/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/base/test/test_taurusbase.py3
-rw-r--r--lib/taurus/qt/qtgui/button/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/button/taurusbutton.py117
-rw-r--r--lib/taurus/qt/qtgui/button/test/test_commandbutton.py3
-rw-r--r--lib/taurus/qt/qtgui/compact/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/compact/abstractswitcher.py15
-rw-r--r--lib/taurus/qt/qtgui/console/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/container/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/container/qcontainer.py91
-rw-r--r--lib/taurus/qt/qtgui/container/taurusbasecontainer.py12
-rw-r--r--lib/taurus/qt/qtgui/container/taurusframe.py3
-rw-r--r--lib/taurus/qt/qtgui/container/taurusgroupbox.py3
-rw-r--r--lib/taurus/qt/qtgui/container/taurusgroupwidget.py3
-rw-r--r--lib/taurus/qt/qtgui/container/taurusmainwindow.py136
-rw-r--r--lib/taurus/qt/qtgui/container/taurusscrollarea.py6
-rw-r--r--lib/taurus/qt/qtgui/container/tauruswidget.py3
-rw-r--r--lib/taurus/qt/qtgui/dialog/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/dialog/taurusconfigurationdialog.py3
-rw-r--r--lib/taurus/qt/qtgui/dialog/taurusinputdialog.py18
-rw-r--r--lib/taurus/qt/qtgui/dialog/taurusmessagebox.py41
-rw-r--r--lib/taurus/qt/qtgui/display/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/display/demo/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/display/demo/qpixmapwidgetdemo.py3
-rw-r--r--lib/taurus/qt/qtgui/display/demo/tauruslabeldemo.py3
-rw-r--r--lib/taurus/qt/qtgui/display/demo/tauruslcddemo.py3
-rw-r--r--lib/taurus/qt/qtgui/display/demo/taurusleddemo.py3
-rw-r--r--lib/taurus/qt/qtgui/display/qfallback.py6
-rw-r--r--lib/taurus/qt/qtgui/display/qled.py43
-rw-r--r--lib/taurus/qt/qtgui/display/qlogo.py4
-rw-r--r--lib/taurus/qt/qtgui/display/qpixmapwidget.py30
-rw-r--r--lib/taurus/qt/qtgui/display/tauruslabel.py9
-rw-r--r--lib/taurus/qt/qtgui/display/tauruslcd.py6
-rw-r--r--lib/taurus/qt/qtgui/display/taurusled.py18
-rw-r--r--lib/taurus/qt/qtgui/display/test/test_tauruslabel.py3
-rw-r--r--lib/taurus/qt/qtgui/editor/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/editor/tauruseditor.py3
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/builder.py3
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/curve.py6
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/curvesmodel.py16
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/image.py13
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/plot.py75
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/scales.py143
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/styles.py3
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/taurustrend2d.py33
-rw-r--r--lib/taurus/qt/qtgui/extra_guiqwt/tools.py6
-rw-r--r--lib/taurus/qt/qtgui/graphic/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/graphic/jdraw/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/graphic/jdraw/jdraw.py3
-rw-r--r--lib/taurus/qt/qtgui/graphic/jdraw/jdraw_parser.py18
-rw-r--r--lib/taurus/qt/qtgui/graphic/jdraw/jdraw_view.py3
-rw-r--r--lib/taurus/qt/qtgui/graphic/jdraw/test/res/__init__.py1
-rw-r--r--lib/taurus/qt/qtgui/graphic/taurusgraphic.py31
-rw-r--r--lib/taurus/qt/qtgui/help/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/help/aboutdialog.py4
-rw-r--r--lib/taurus/qt/qtgui/icon/catalog.py3
-rw-r--r--lib/taurus/qt/qtgui/icon/icon.py102
-rw-r--r--lib/taurus/qt/qtgui/input/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/input/choicedlg.py100
-rw-r--r--lib/taurus/qt/qtgui/input/qwheel.py12
-rw-r--r--lib/taurus/qt/qtgui/input/tauruscheckbox.py3
-rw-r--r--lib/taurus/qt/qtgui/input/tauruscombobox.py26
-rw-r--r--lib/taurus/qt/qtgui/input/tauruslineedit.py9
-rw-r--r--lib/taurus/qt/qtgui/input/taurusspinbox.py4
-rw-r--r--lib/taurus/qt/qtgui/input/tauruswheel.py3
-rw-r--r--lib/taurus/qt/qtgui/model/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/model/qbasemodel.py24
-rw-r--r--lib/taurus/qt/qtgui/panel/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/panel/qdataexportdialog.py10
-rw-r--r--lib/taurus/qt/qtgui/panel/qdoublelist.py12
-rw-r--r--lib/taurus/qt/qtgui/panel/qrawdatachooser.py3
-rw-r--r--lib/taurus/qt/qtgui/panel/report/albareport.py3
-rw-r--r--lib/taurus/qt/qtgui/panel/report/basicreport.py3
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusconfigeditor.py61
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusconfigurationpanel.py3
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusdevicepanel.py1
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusform.py151
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusinputpanel.py18
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusmessagepanel.py96
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusmodelchooser.py87
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusmodellist.py36
-rw-r--r--lib/taurus/qt/qtgui/panel/taurusvalue.py94
-rw-r--r--lib/taurus/qt/qtgui/panel/test/test_taurusform.py3
-rw-r--r--lib/taurus/qt/qtgui/panel/test/test_taurusvalue.py3
-rw-r--r--lib/taurus/qt/qtgui/plot/__init__.py1
-rw-r--r--lib/taurus/qt/qtgui/resource/taurus_resource_utils.py35
-rw-r--r--lib/taurus/qt/qtgui/style/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/style/nebula.py3
-rw-r--r--lib/taurus/qt/qtgui/table/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/table/qdictionary.py3
-rw-r--r--lib/taurus/qt/qtgui/table/qlogtable.py6
-rw-r--r--lib/taurus/qt/qtgui/table/qtable.py3
-rw-r--r--lib/taurus/qt/qtgui/table/taurusdbtable.py3
-rw-r--r--lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py3
-rw-r--r--lib/taurus/qt/qtgui/table/taurusgrid.py2
-rw-r--r--lib/taurus/qt/qtgui/table/taurustable.py6
-rw-r--r--lib/taurus/qt/qtgui/table/taurusvaluestable.py69
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/__init__.py1
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/appsettingswizard.py19
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/conf/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/conf/gui_noconf.py3
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/conf/gui_pureconf.py3
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/conf/gui_selfconf.py3
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/paneldescriptionwizard.py13
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/taurusgui.py175
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/test/res/conf.py3
-rw-r--r--lib/taurus/qt/qtgui/taurusgui/utils.py56
-rw-r--r--lib/taurus/qt/qtgui/test/base.py7
-rw-r--r--lib/taurus/qt/qtgui/test/test_widgets_general.py1
-rw-r--r--lib/taurus/qt/qtgui/tree/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/tree/qtree.py3
-rw-r--r--lib/taurus/qt/qtgui/tree/taurusdbtree.py10
-rw-r--r--lib/taurus/qt/qtgui/tree/taurustree.py6
-rw-r--r--lib/taurus/qt/qtgui/util/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/util/qdraganddropdebug.py3
-rw-r--r--lib/taurus/qt/qtgui/util/taurusaction.py34
-rw-r--r--lib/taurus/qt/qtgui/util/taurusactionfactory.py3
-rw-r--r--lib/taurus/qt/qtgui/util/tauruscolor.py3
-rw-r--r--lib/taurus/qt/qtgui/util/taurusropepatch.py3
-rw-r--r--lib/taurus/qt/qtgui/util/taurusscreenshot.py12
-rw-r--r--lib/taurus/qt/qtgui/util/tauruswidgetfactory.py5
-rw-r--r--lib/taurus/qt/qtgui/util/test/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/util/test/test_ui/__init__.py3
-rw-r--r--lib/taurus/qt/qtgui/util/test/test_ui/test_ui.py3
-rw-r--r--lib/taurus/qt/qtgui/util/ui.py20
-rw-r--r--lib/taurus/qt/qtgui/util/validator.py30
-rw-r--r--lib/taurus/test/base.py4
-rw-r--r--lib/taurus/test/fuzzytest.py62
-rw-r--r--lib/taurus/test/moduleexplorer.py64
-rw-r--r--lib/taurus/test/pytest.py6
-rw-r--r--lib/taurus/test/resource.py16
-rw-r--r--lib/taurus/test/skip.py7
-rw-r--r--lib/taurus/test/test_import.py3
267 files changed, 3659 insertions, 2039 deletions
diff --git a/doc/auto_rst4api.py b/doc/auto_rst4api.py
index ea347456..9cd967b6 100644
--- a/doc/auto_rst4api.py
+++ b/doc/auto_rst4api.py
@@ -25,7 +25,8 @@
###########################################################################
""" Creates a tree of dirs and restructured text stub files for documenting
-the API of a python module with sphinx"""
+the API of a python module with sphinx
+"""
import os
import importlib
@@ -34,7 +35,8 @@ from jinja2 import Environment, FileSystemLoader
def taurusabspath(*path):
"""A method to determine absolute path for a given relative path to the
- directory where the setup.py script is located"""
+ directory where the setup.py script is located
+ """
this_dir = os.path.dirname(os.path.abspath(__file__))
setup_dir = os.path.abspath(os.path.join(this_dir, os.pardir))
return os.path.join(setup_dir, *path)
@@ -66,11 +68,18 @@ class Auto_rst4API_Creator(object):
overwrite_old=False,
):
"""
- :param templates: (str) path to dir where template files are located
- :param moduletemplate: (str) name of the template to be used for module pages
- :param classtemplate: (str) name of the template to be used for class pages
- :param classindextemplate: (str) name of the template to be used for class index page
- :param verbose: (bool) If True (default) status messages will be printed to stdout
+ :param templates: path to dir where template files are located
+ :type templates: str
+ :param moduletemplate: name of the template to be used for module pages
+ :type moduletemplate: str
+ :param classtemplate: name of the template to be used for class pages
+ :type classtemplate: str
+ :param classindextemplate: name of the template to be used for class
+ index page
+ :type classindextemplate: str
+ :param verbose: If True (default) status messages will be printed to
+ stdout
+ :type verbose: bool
"""
self.verbose = verbose
@@ -98,7 +107,8 @@ class Auto_rst4API_Creator(object):
"""Removes any previously autogenerated rst file in the given path
or its subdirectories
- :param apipath: (str) directory to clean
+ :param apipath: directory to clean
+ :type apipath: str
"""
for dirpath, dirnames, filenames in os.walk(apipath):
for f in filenames:
@@ -115,10 +125,11 @@ class Auto_rst4API_Creator(object):
"""
Creates a class index page using the classindextemplate.
- :param info: (dict) dictionary containing the information about the
- items to document for this module (as generated by
- :meth:`exploreModule`
- :param ofname: (str) output file name
+ :param info: dictionary containing the information about the items to
+ document for this module (as generated by :meth:`exploreModule`
+ :type info: dict
+ :param ofname: output file name
+ :type ofname: str
"""
classes = ModuleExplorer.getAll(
info, "localclassnames"
@@ -150,11 +161,11 @@ class Auto_rst4API_Creator(object):
"""creates rst stub files for modules and classes according to the
information contained in info.
- :param info: (dict) dictionary containing the information about the
- items to document for this module (as generated by
- :meth:`exploreModule`)
- :docparentpath: (str) path to the directory in which the documentation
- files will be written
+ :param info: dictionary containing the information about the items to
+ document for this module (as generated by :meth:`exploreModule`)
+ :docparentpath: (str) path to the directory in which the
+ documentation files will be written
+ :type info: dict
"""
# create the module doc dir if it didn't exist
absdocpath = os.path.join(docparentpath, info["basemodulename"])
@@ -209,15 +220,18 @@ class Auto_rst4API_Creator(object):
documentation files for the given module and its submodules. It also
creates a class index for the root module
- :param modulename: (str) name of the module to document
- :docparentpath: (str) path to the directory in which the documentation
- files will be written
- :param exclude_patterns: (seq<str>) sequence of strings containing regexp
- patterns. Each candidate to be documented will be
- matched against these patterns and will be excluded
- if it matches any of them.
+ :param modulename: name of the module to document :docparentpath: (str)
+ path to the directory in which the documentation files will be
+ written
+ :type modulename: str
+ :param exclude_patterns: sequence of strings containing regexp
+ patterns. Each candidate to be documented will be matched against
+ these patterns and will be excluded if it matches any of them.
+ :type exclude_patterns: seq<str>
- :return: (list<str>) list of warning messages
+
+ :return: list of warning messages
+ :rtype: list<str>
"""
if self.verbose:
print("\nDocumenting %s..." % modulename)
diff --git a/doc/source/sphinxext/taurusextension.py b/doc/source/sphinxext/taurusextension.py
index 2d977fa1..c5025a36 100644
--- a/doc/source/sphinxext/taurusextension.py
+++ b/doc/source/sphinxext/taurusextension.py
@@ -23,7 +23,8 @@
##
##############################################################################
-"""helper methods for taurus sphinx documentation"""
+"""helper methods for taurus sphinx documentation
+"""
__expr = ("or",)
diff --git a/lib/taurus/__init__.py b/lib/taurus/__init__.py
index f98f0a9a..85d738f9 100644
--- a/lib/taurus/__init__.py
+++ b/lib/taurus/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""The main taurus module. It contains a reduced set of wrappers around the
-real taurus model classes and information regarding the current release."""
+real taurus model classes and information regarding the current release.
+"""
from .core import release as __R
diff --git a/lib/taurus/cli/__init__.py b/lib/taurus/cli/__init__.py
index 174bb88c..2c711d37 100644
--- a/lib/taurus/cli/__init__.py
+++ b/lib/taurus/cli/__init__.py
@@ -39,7 +39,6 @@ that can be used by taurus plugins. For list of available options,
see :mod:`taurus.cli.common`
.. seealso:: :mod:`taurus.cli.alt`
-
"""
from .cli import main, register_subcommands, taurus_cmd
diff --git a/lib/taurus/cli/alt.py b/lib/taurus/cli/alt.py
index 35d75ed7..24ecfbee 100644
--- a/lib/taurus/cli/alt.py
+++ b/lib/taurus/cli/alt.py
@@ -84,7 +84,6 @@ to provide the following minimum API:
- wintitle=window_name,
- should implement `setRGBmode(mode)` where mode is one of `"gray"`, `"rgb"`
-
"""
import sys
diff --git a/lib/taurus/cli/common.py b/lib/taurus/cli/common.py
index 5f50540b..270c4a0e 100644
--- a/lib/taurus/cli/common.py
+++ b/lib/taurus/cli/common.py
@@ -79,7 +79,6 @@ script::
if __name__ == '__main__':
foo()
-
"""
import click
diff --git a/lib/taurus/cli/test/__init__.py b/lib/taurus/cli/test/__init__.py
index 294cb563..a22ac116 100644
--- a/lib/taurus/cli/test/__init__.py
+++ b/lib/taurus/cli/test/__init__.py
@@ -21,4 +21,5 @@
##
#############################################################################
-"""Tests for taurus.cli"""
+"""Tests for taurus.cli
+"""
diff --git a/lib/taurus/console/__init__.py b/lib/taurus/console/__init__.py
index f2430057..99763833 100644
--- a/lib/taurus/console/__init__.py
+++ b/lib/taurus/console/__init__.py
@@ -23,6 +23,7 @@
##
#############################################################################
-""" """
+"""
+"""
from .enums import *
diff --git a/lib/taurus/console/enums.py b/lib/taurus/console/enums.py
index bf8242c5..02378f53 100644
--- a/lib/taurus/console/enums.py
+++ b/lib/taurus/console/enums.py
@@ -23,7 +23,8 @@
##
#############################################################################
-""" """
+"""
+"""
__all__ = ["Alignment"]
diff --git a/lib/taurus/console/list.py b/lib/taurus/console/list.py
index 50102d2e..f36937fa 100644
--- a/lib/taurus/console/list.py
+++ b/lib/taurus/console/list.py
@@ -23,7 +23,8 @@
##
#############################################################################
-""" """
+"""
+"""
import textwrap
from collections.abc import Sequence
diff --git a/lib/taurus/console/table.py b/lib/taurus/console/table.py
index 540e966e..4241c7e8 100644
--- a/lib/taurus/console/table.py
+++ b/lib/taurus/console/table.py
@@ -23,7 +23,8 @@
##
#############################################################################
-""" """
+"""
+"""
from functools import reduce
__all__ = ["Table"]
diff --git a/lib/taurus/console/util/__init__.py b/lib/taurus/console/util/__init__.py
index fe05347a..f0235e61 100644
--- a/lib/taurus/console/util/__init__.py
+++ b/lib/taurus/console/util/__init__.py
@@ -23,4 +23,5 @@
##
#############################################################################
-""" """
+"""
+"""
diff --git a/lib/taurus/core/__init__.py b/lib/taurus/core/__init__.py
index b19d1796..d74e92f6 100644
--- a/lib/taurus/core/__init__.py
+++ b/lib/taurus/core/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""The core module"""
+"""The core module
+"""
import taurus.tauruscustomsettings
diff --git a/lib/taurus/core/epics/epicsattribute.py b/lib/taurus/core/epics/epicsattribute.py
index c4b61707..b6daba0e 100644
--- a/lib/taurus/core/epics/epicsattribute.py
+++ b/lib/taurus/core/epics/epicsattribute.py
@@ -220,9 +220,11 @@ class EpicsAttribute(TaurusAttribute):
def read(self, cache=True):
"""returns the value of the attribute.
- :param cache: (bool) If True (default), the last calculated value will
- be returned. If False, the referenced values will be re-
- read and the transformation string will be re-evaluated
+ :param cache: If True (default), the last calculated value will be
+ returned. If False, the referenced values will be re- read and the
+ transformation string will be re-evaluated
+ :type cache: bool
+
:return: attribute value
"""
diff --git a/lib/taurus/core/epics/epicsfactory.py b/lib/taurus/core/epics/epicsfactory.py
index 84ed4e41..160a68ba 100644
--- a/lib/taurus/core/epics/epicsfactory.py
+++ b/lib/taurus/core/epics/epicsfactory.py
@@ -89,9 +89,12 @@ class EpicsFactory(Singleton, TaurusFactory, Logger):
def getAuthority(self, name=None):
"""Obtain the Epics (ca) authority object.
- :param name: (str) only a dummy authority ("ca://") is supported
+ :param name: only a dummy authority ("ca://") is supported
+ :type name: str
- :return: (EpicsAuthority)
+
+ :return:
+ :rtype: EpicsAuthority
"""
if name is None:
name = "ca://"
@@ -107,9 +110,13 @@ class EpicsFactory(Singleton, TaurusFactory, Logger):
def getDevice(self, dev_name):
"""Obtain the EpicsDevice object.
- :param dev_name: (str) only one dummy device ("") is supported
+ :param dev_name: only one dummy device ("") is supported
+ :type dev_name: str
+
+
+ :return:
+ :rtype: EpicsDevice
- :return: (EpicsDevice)
.. todo:: epics.Device may be wrapped as taurus device...
"""
@@ -131,10 +138,14 @@ class EpicsFactory(Singleton, TaurusFactory, Logger):
returned. Otherwise a new instance is stored and returned. The
device associated to this attribute will also be created if necessary.
- :param attr_name: (str) the attribute name string. See
- :mod:`taurus.core.epics` for valid attribute names
+ :param attr_name: the attribute name string. See
+ :mod:`taurus.core.epics` for valid attribute names
+ :type attr_name: str
+
+
+ :return:
+ :rtype: EpicsAttribute
- :return: (EpicsAttribute)
:raises: :TaurusException: if the given name is invalid.
"""
diff --git a/lib/taurus/core/epics/test/test_epicsattribute.py b/lib/taurus/core/epics/test/test_epicsattribute.py
index c38d0c22..1e3c3627 100644
--- a/lib/taurus/core/epics/test/test_epicsattribute.py
+++ b/lib/taurus/core/epics/test/test_epicsattribute.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for epicsattributes..."""
+"""Test for epicsattributes...
+"""
import os
import sys
diff --git a/lib/taurus/core/epics/test/test_epicsvalidator.py b/lib/taurus/core/epics/test/test_epicsvalidator.py
index f0c7a3fd..9cafe247 100644
--- a/lib/taurus/core/epics/test/test_epicsvalidator.py
+++ b/lib/taurus/core/epics/test/test_epicsvalidator.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.epics.test.test_epicsvalidator..."""
+"""Test for taurus.core.epics.test.test_epicsvalidator...
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/core/evaluation/evalattribute.py b/lib/taurus/core/evaluation/evalattribute.py
index 25162d9f..1c957139 100644
--- a/lib/taurus/core/evaluation/evalattribute.py
+++ b/lib/taurus/core/evaluation/evalattribute.py
@@ -158,7 +158,8 @@ class EvaluationAttrValue(TaurusAttrValue):
def __fix_int(self, value):
"""cast value to int if it is an integer.
- Works on scalar and non-scalar values"""
+ Works on scalar and non-scalar values
+ """
if self.type != DataType.Integer:
return value
try:
@@ -245,11 +246,12 @@ class EvaluationAttribute(TaurusAttribute):
- It is unique for this object during all its life
- It is a string that can be used as a variable or method name
- :param obj: (object) the python object whose id is requested
- :param idFormat: (str) a format string containing a "`%i`" which,
- when expanded must be a valid variable name
- (i.e. it must match
- `[a-zA-Z_][a-zA-Z0-9_]*`). The default is `_V%i_`
+ :param obj: the python object whose id is requested
+ :type obj: object
+ :param idFormat: a format string containing a "`%i`" which, when
+ expanded must be a valid variable name (i.e. it must match `[a-zA-
+ Z_][a-zA-Z0-9_]*`). The default is `_V%i_`
+ :type idFormat: str
"""
return idFormat % id(obj)
@@ -259,11 +261,14 @@ class EvaluationAttribute(TaurusAttribute):
the evaluator. It also connects any referenced attributes so that the
transformation gets re-evaluated if they change.
- :param trstring: (str) a string to be pre-processed
+ :param trstring: a string to be pre-processed
+ :type trstring: str
+
- :return: (tuple<str,bool>) a tuple containing the processed string
- and a boolean indicating if the preprocessing was successful.
- if ok==True, the string is ready to be evaluated
+ :return: a tuple containing the processed string and a boolean
+ indicating if the preprocessing was successful. if ok==True, the
+ string is ready to be evaluated
+ :rtype: tuple<str,bool>
"""
# disconnect previously referenced attributes and clean the list
for ref in self._references:
@@ -308,7 +313,8 @@ class EvaluationAttribute(TaurusAttribute):
existing taurus attribute corresponding to the match.
The attribute is created if it didn't previously exist.
- :param ref: (str) string corresponding to a reference. e.g. eval:1
+ :param ref: string corresponding to a reference. e.g. eval:1
+ :type ref: str
"""
refobj = self.__createReference(ref)
return self.getId(refobj)
@@ -320,10 +326,12 @@ class EvaluationAttribute(TaurusAttribute):
it to the reference list and adds its id and current value to the
symbols dictionary of the evaluator.
- :param ref: (str)
+ :param ref:
+ :type ref: str
- :return: (TaurusAttribute)
+ :return:
+ :rtype: TaurusAttribute
"""
refobj = Attribute(ref)
if refobj not in self._references:
@@ -400,10 +408,14 @@ class EvaluationAttribute(TaurusAttribute):
dimension attributes e.g. 1D, 2D the type corresponds to the type of the
first element.
- :param value: (obj)
- :param dformat: (taurus.DataFormat)
+ :param value:
+ :type value: obj
+ :param dformat:
+ :type dformat: taurus.DataFormat
+
- :return: (taurus.DataType)
+ :return:
+ :rtype: taurus.DataType
"""
# TODO: Should we fall back to DataType.Object instead of None?
try: # handle Quantities
@@ -453,9 +465,11 @@ class EvaluationAttribute(TaurusAttribute):
def read(self, cache=True):
"""returns the value of the attribute.
- :param cache: (bool) If True (default), the last calculated value will
- be returned. If False, the referenced values will be re-
- read and the transformation string will be re-evaluated
+ :param cache: If True (default), the last calculated value will be
+ returned. If False, the referenced values will be re- read and the
+ transformation string will be re-evaluated
+ :type cache: bool
+
:return: attribute value
"""
@@ -491,7 +505,8 @@ class EvaluationAttribute(TaurusAttribute):
"""Add a TaurusListener object in the listeners list.
If it is the first listener, it triggers the subscription to
the referenced attributes.
- If the listener is already registered nothing happens."""
+ If the listener is already registered nothing happens.
+ """
initial_subscription_state = self.__subscription_state
ret = TaurusAttribute.addListener(self, listener)
@@ -519,7 +534,8 @@ class EvaluationAttribute(TaurusAttribute):
def removeListener(self, listener):
"""Remove a TaurusListener from the listeners list. If polling enabled
and it is the last element then stop the polling timer.
- If the listener is not registered nothing happens."""
+ If the listener is not registered nothing happens.
+ """
ret = TaurusAttribute.removeListener(self, listener)
if ret and not self.hasListeners():
diff --git a/lib/taurus/core/evaluation/evalfactory.py b/lib/taurus/core/evaluation/evalfactory.py
index 7fce72e9..7e52b13c 100644
--- a/lib/taurus/core/evaluation/evalfactory.py
+++ b/lib/taurus/core/evaluation/evalfactory.py
@@ -83,9 +83,12 @@ class EvaluationFactory(Singleton, TaurusFactory, Logger):
def getAuthority(self, name=None):
"""Obtain the EvaluationDatabase object.
- :param db_name: (str) this is ignored because only one database is supported
+ :param db_name: this is ignored because only one database is supported
+ :type db_name: str
- :return: (EvaluationDatabase)
+
+ :return:
+ :rtype: EvaluationDatabase
"""
if name is None:
name = "eval://localhost"
@@ -105,10 +108,14 @@ class EvaluationFactory(Singleton, TaurusFactory, Logger):
corresponding device already exists, the existing instance is returned.
Otherwise a new instance is stored and returned.
- :param dev_name: (str) the device name string. See
- :mod:`taurus.core.evaluation` for valid device names
+ :param dev_name: the device name string. See
+ :mod:`taurus.core.evaluation` for valid device names
+ :type dev_name: str
+
+
+ :return:
+ :rtype: EvaluationDevice
- :return: (EvaluationDevice)
@throws TaurusException if the given name is invalid.
"""
@@ -179,14 +186,17 @@ class EvaluationFactory(Singleton, TaurusFactory, Logger):
returned. Otherwise a new instance is stored and returned. The evaluator
device associated to this attribute will also be created if necessary.
- :param attr_name: (str) the attribute name string. See
- :mod:`taurus.core.evaluation` for valid attribute
- names
+ :param attr_name: the attribute name string. See
+ :mod:`taurus.core.evaluation` for valid attribute names
+ :type attr_name: str
+
Any aditional keyword arguments will be passed directly to the
constructor of `:class:EvaluationAttribute`
- :return: (EvaluationAttribute)
+ :return:
+ :rtype: EvaluationAttribute
+
@throws TaurusException if the given name is invalid.
"""
diff --git a/lib/taurus/core/evaluation/evalvalidator.py b/lib/taurus/core/evaluation/evalvalidator.py
index 54f4f225..6716378f 100644
--- a/lib/taurus/core/evaluation/evalvalidator.py
+++ b/lib/taurus/core/evaluation/evalvalidator.py
@@ -58,16 +58,21 @@ def _findAllTokensBetweenChars(string, start, end, n=None):
--> [(1,'foo'), (9, 'zig{zag}')]
- :param string: (str) the expression to parse
- :param start: (str) the char delimiting the start of a token
- :param end: (str) the char delimiting the end of a token
- :param n: (int or None) If an int is passed, it sets the maximum number
- of tokens to be found
-
- :return: (list(<int>,<str>)) a list of (idx, token) tuples. The idx is the
- position of the token in `string`
- (tokens d not include the delimiting chars not including the
- brackets)
+ :param string: the expression to parse
+ :type string: str
+ :param start: the char delimiting the start of a token
+ :type start: str
+ :param end: the char delimiting the end of a token
+ :type end: str
+ :param n: If an int is passed, it sets the maximum number of tokens to be
+ found
+ :type n: int or None
+
+
+ :return: ) a list of (idx, token) tuples. The idx is the position of the
+ token in `string` (tokens d not include the delimiting chars not
+ including the brackets)
+ :rtype: list(<int>,<str>
"""
if start == end:
raise ValueError("star_char must be different from end_char")
@@ -175,7 +180,8 @@ class EvaluationDeviceNameValidator(TaurusDeviceNameValidator):
def getUriGroups(self, name, strict=None):
"""reimplemented from :class:`TaurusDeviceNameValidator` to provide
- backwards compatibility with ol syntax"""
+ backwards compatibility with ol syntax
+ """
groups = TaurusDeviceNameValidator.getUriGroups(
self, name, strict=strict
)
@@ -257,12 +263,13 @@ class EvaluationAttributeNameValidator(TaurusAttributeNameValidator):
Note that eval references in expr (i.e. text within curly brackets)
is not substituted.
- :param expr: (str) string that may contain symbols defined in symbolMap
- :param symbolMap: (dict or str) dictionary whose keys (strings) are
- symbols to be substituted in `expr` and whose values
- are the corresponding replacements. Alternatively, a
- string containing a semi-colon separated list of
- symbol=value pairs can also be passed.
+ :param expr: string that may contain symbols defined in symbolMap
+ :type expr: str
+ :param symbolMap: dictionary whose keys (strings) are symbols to be
+ substituted in `expr` and whose values are the corresponding
+ replacements. Alternatively, a string containing a semi-colon
+ separated list of symbol=value pairs can also be passed.
+ :type symbolMap: dict or str
"""
if isinstance(substmap, str):
substmap = dict(K_EQUALS_V_RE.findall(substmap))
@@ -297,9 +304,11 @@ class EvaluationAttributeNameValidator(TaurusAttributeNameValidator):
Example: val.getRefs('{foo}bar{zig{zag}}boom') --> ['foo', 'zig{zag}']
- :param expr: (str) the expression to parse
+ :param expr: the expression to parse
+ :type expr: str
:param ign_quoted: If True (default) ignore refs within quotes
+
:return (list<str>) a list of refs (not including the brackets)
"""
refs = _findAllTokensBetweenChars(expr, "{", "}")
@@ -320,12 +329,16 @@ class EvaluationAttributeNameValidator(TaurusAttributeNameValidator):
`substring`
is replaced by `repl`
- :param string: (str) string to be used
- :param substring: (str) substring to be replaced
- :param repl: (str) replacement
+ :param string: string to be used
+ :type string: str
+ :param substring: substring to be replaced
+ :type substring: str
+ :param repl: replacement
+ :type repl: str
- :return: (str)
+ :return:
+ :rtype: str
"""
idx = string.find(substring)
while _isQuoted(string, substring, idx):
@@ -360,7 +373,8 @@ class EvaluationAttributeNameValidator(TaurusAttributeNameValidator):
def getUriGroups(self, name, strict=None):
"""reimplemented from :class:`TaurusAttributeNameValidator` to provide
- backwards compatibility with old syntax"""
+ backwards compatibility with old syntax
+ """
# mangle refs before matching the pattern to sanitize them
refs = self.getRefs(name, ign_quoted=False)
@@ -493,10 +507,13 @@ class EvaluationAttributeNameValidator(TaurusAttributeNameValidator):
"""
Returns the expanded expression from the attribute name URI
- :param name: (str) eval attribute URI
+ :param name: eval attribute URI
+ :type name: str
+
- :return: (str) the expression (from the name )expanded with any
- substitution k,v pairs also defined in the name
+ :return: the expression (from the name )expanded with any substitution
+ k,v pairs also defined in the name
+ :rtype: str
"""
groups = self.getUriGroups(name)
if groups is None:
diff --git a/lib/taurus/core/evaluation/test/test_evalattribute.py b/lib/taurus/core/evaluation/test/test_evalattribute.py
index 0e738780..3192586a 100644
--- a/lib/taurus/core/evaluation/test/test_evalattribute.py
+++ b/lib/taurus/core/evaluation/test/test_evalattribute.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.tango.test.test_tangovalidator..."""
+"""Test for taurus.core.tango.test.test_tangovalidator...
+"""
# __all__ = []
diff --git a/lib/taurus/core/evaluation/test/test_evalfactory.py b/lib/taurus/core/evaluation/test/test_evalfactory.py
index fbe2e56c..03ce03ca 100644
--- a/lib/taurus/core/evaluation/test/test_evalfactory.py
+++ b/lib/taurus/core/evaluation/test/test_evalfactory.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.evaluation.test.test_evalfactory..."""
+"""Test for taurus.core.evaluation.test.test_evalfactory...
+"""
import re
diff --git a/lib/taurus/core/evaluation/test/test_evalvalidator.py b/lib/taurus/core/evaluation/test/test_evalvalidator.py
index 91a81d95..2e54c699 100644
--- a/lib/taurus/core/evaluation/test/test_evalvalidator.py
+++ b/lib/taurus/core/evaluation/test/test_evalvalidator.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.evaluation.test.test_evalvalidator..."""
+"""Test for taurus.core.evaluation.test.test_evalvalidator...
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/core/init_bkcomp.py b/lib/taurus/core/init_bkcomp.py
index 1f6f52d9..7dbfa93d 100644
--- a/lib/taurus/core/init_bkcomp.py
+++ b/lib/taurus/core/init_bkcomp.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""The core module"""
+"""The core module
+"""
from . import release as Release
diff --git a/lib/taurus/core/init_lightweight.py b/lib/taurus/core/init_lightweight.py
index 9935bc2d..7ae01a1a 100644
--- a/lib/taurus/core/init_lightweight.py
+++ b/lib/taurus/core/init_lightweight.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""The core module"""
+"""The core module
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/core/resource/__init__.py b/lib/taurus/core/resource/__init__.py
index 8e4d5fd1..07af4e6a 100644
--- a/lib/taurus/core/resource/__init__.py
+++ b/lib/taurus/core/resource/__init__.py
@@ -97,7 +97,6 @@ mapped model type. In other words: if the model name 'eval:Q(rand())' is
mapped to the `myattr` resource name, calling `taurus.Attribute('res:myattr')`
will return a :class:`EvaluationAttribute`, not a `ResAttribute` (`ResAttribute`
is not even defined).
-
"""
from .resfactory import *
diff --git a/lib/taurus/core/resource/resfactory.py b/lib/taurus/core/resource/resfactory.py
index ef574238..8086b8a3 100644
--- a/lib/taurus/core/resource/resfactory.py
+++ b/lib/taurus/core/resource/resfactory.py
@@ -59,7 +59,8 @@ class ResourcesFactory(Singleton, TaurusFactory, Logger):
def init(self, *args, **kwargs):
"""Singleton instance initialization.
- **For internal usage only**"""
+ **For internal usage only**
+ """
name = self.__class__.__name__
self.call__init__(Logger, name)
self.call__init__(TaurusFactory)
@@ -74,14 +75,19 @@ class ResourcesFactory(Singleton, TaurusFactory, Logger):
def reloadResource(self, obj=None, priority=1, name=None):
"""(Re)Loads the given resource.
- :param obj: (dict or file or None) the resource object. Default is
- None meaning in will (re)load the default resource:
- taurus_resources.py from the application directory
- :param priority: (int) the resource priority. Default is 1 meaning
- maximum priority
- :param name: (str) an optional name to give to the resource
+ :param obj: the resource object. Default is None meaning in will
+ (re)load the default resource: taurus_resources.py from the
+ application directory
+ :type obj: dict or file or None
+ :param priority: the resource priority. Default is 1 meaning maximum
+ priority
+ :type priority: int
+ :param name: an optional name to give to the resource
+ :type name: str
+
- :return: (dict) a dictionary version of the given resource object
+ :return: a dictionary version of the given resource object
+ :rtype: dict
"""
if priority < 1:
raise ValueError("priority must be >=1")
@@ -140,9 +146,12 @@ class ResourcesFactory(Singleton, TaurusFactory, Logger):
def getValue(self, key):
"""Returns the value for a given key
- :param key: (str) a key
+ :param key: a key
+ :type key: str
- :return: (str) the value for the given key
+
+ :return: the value for the given key
+ :rtype: str
"""
if self._resource_count == 0:
try:
@@ -167,11 +176,13 @@ class ResourcesFactory(Singleton, TaurusFactory, Logger):
"""
Obtain the class object corresponding to the given name.
- :param absolute_name: (str) the object absolute name string
+ :param absolute_name: the object absolute name string
+ :type absolute_name: str
+
- :return: (taurus.core.taurusmodel.TaurusModel or None) the class
- for the model object mapped by absolute_name, or None if
- absolute_name is invalid.
+ :return: the class for the model object mapped by absolute_name, or
+ None if absolute_name is invalid.
+ :rtype: taurus.core.taurusmodel.TaurusModel or None
"""
validators = (
self.getAttributeNameValidator(),
@@ -193,10 +204,13 @@ class ResourcesFactory(Singleton, TaurusFactory, Logger):
"""
Obtain the authority model object referenced by name.
- :param name: (str) name
+ :param name: name
+ :type name: str
- :return: (taurus.core.taurusauthority.TaurusAuthority) authority object
- :raise: (taurus.core.taurusexception.TaurusException) if name is invalid
+
+ :return: authority object :raise:
+ (taurus.core.taurusexception.TaurusException) if name is invalid
+ :rtype: taurus.core.taurusauthority.TaurusAuthority
"""
groups = self.getAuthorityNameValidator().getUriGroups(name)
if groups is None:
@@ -209,10 +223,13 @@ class ResourcesFactory(Singleton, TaurusFactory, Logger):
"""
Obtain the device model object referenced by name.
- :param name: (str) name
+ :param name: name
+ :type name: str
+
- :return: (taurus.core.taurusdevice.TaurusDevice) device object
- :raise: (taurus.core.taurusexception.TaurusException) if name is invalid
+ :return: device object :raise:
+ (taurus.core.taurusexception.TaurusException) if name is invalid
+ :rtype: taurus.core.taurusdevice.TaurusDevice
"""
groups = self.getDeviceNameValidator().getUriGroups(name)
if groups is None:
@@ -225,10 +242,13 @@ class ResourcesFactory(Singleton, TaurusFactory, Logger):
"""
Obtain the attribute model object referenced by name.
- :param name: (str) name
+ :param name: name
+ :type name: str
+
- :return: (taurus.core.taurusattribute.TaurusAttribute) attribute object
- :raise: (taurus.core.taurusexception.TaurusException) if name is invalid
+ :return: attribute object :raise:
+ (taurus.core.taurusexception.TaurusException) if name is invalid
+ :rtype: taurus.core.taurusattribute.TaurusAttribute
"""
groups = self.getAttributeNameValidator().getUriGroups(name)
if groups is None:
diff --git a/lib/taurus/core/resource/resvalidator.py b/lib/taurus/core/resource/resvalidator.py
index aaf1db90..0924a354 100644
--- a/lib/taurus/core/resource/resvalidator.py
+++ b/lib/taurus/core/resource/resvalidator.py
@@ -66,7 +66,8 @@ class _ResNameValidator(object):
def _getValueValidator(self, name):
"""Return the name validator for the mapped model name scheme
- :param name: (str) resource name
+ :param name: resource name
+ :type name: str
:return: A specific TaurusValidator
"""
scheme = getSchemeFromName(name)
@@ -102,7 +103,8 @@ class _ResNameValidator(object):
def isValid(self, name, *args, **kwargs):
"""Checks validity of the key (resname) and also of the value
- (model name)"""
+ (model name)
+ """
key = self._getKey(name)
if key is None:
return False
diff --git a/lib/taurus/core/resource/test/test_resfactory.py b/lib/taurus/core/resource/test/test_resfactory.py
index c492bda9..2994c5fc 100644
--- a/lib/taurus/core/resource/test/test_resfactory.py
+++ b/lib/taurus/core/resource/test/test_resfactory.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.resource.test.test_resfactory..."""
+"""Test for taurus.core.resource.test.test_resfactory...
+"""
import os.path as osp
import taurus
from taurus.test import insertTest
diff --git a/lib/taurus/core/resource/test/test_resvalidator.py b/lib/taurus/core/resource/test/test_resvalidator.py
index 89ab94e8..90b1816d 100644
--- a/lib/taurus/core/resource/test/test_resvalidator.py
+++ b/lib/taurus/core/resource/test/test_resvalidator.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.resource.test.test_resvalidator..."""
+"""Test for taurus.core.resource.test.test_resvalidator...
+"""
import os.path as osp
@@ -45,7 +46,8 @@ from taurus.core.resource.resvalidator import (
class _AbstractResNameValidatorTestCase(AbstractNameValidatorTestCase):
"""Abstract class for creating res validator test cases. Derived classes
- need to provide the `res_map` dictionary class member"""
+ need to provide the `res_map` dictionary class member
+ """
res_map = {}
diff --git a/lib/taurus/core/tango/enums.py b/lib/taurus/core/tango/enums.py
index 5d7005ff..af97caf2 100644
--- a/lib/taurus/core/tango/enums.py
+++ b/lib/taurus/core/tango/enums.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains all basic tango enumerations"""
+"""This module contains all basic tango enumerations
+"""
__all__ = [
"TangoObjectType",
@@ -129,7 +130,6 @@ class DevState(IntEnum):
D1.OPEN == 3 # --> True
D1.OPEN is 3 # --> False
D1.OPEN is D2.OPEN # --> False
-
"""
ON = 0
diff --git a/lib/taurus/core/tango/img/__init__.py b/lib/taurus/core/tango/img/__init__.py
index 7b3a3272..5f63a877 100644
--- a/lib/taurus/core/tango/img/__init__.py
+++ b/lib/taurus/core/tango/img/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""The img package. It contains specific part of tango devices dedicated to
-images (CCDs, detectors, etc)"""
+images (CCDs, detectors, etc)
+"""
from .img import *
diff --git a/lib/taurus/core/tango/img/img.py b/lib/taurus/core/tango/img/img.py
index 5439eac2..8e544938 100644
--- a/lib/taurus/core/tango/img/img.py
+++ b/lib/taurus/core/tango/img/img.py
@@ -24,7 +24,8 @@
#############################################################################
"""The img submodule. It contains specific device implementation for CCDs and
-2D detectors"""
+2D detectors
+"""
from taurus.core.taurusbasetypes import TaurusEventType
from taurus.core.tango import TangoDevice
@@ -71,7 +72,8 @@ class ImageDevice(TangoDevice):
class ImageCounterDevice(ImageDevice):
"""A class encapsulating a generic image device that has an image counter
- attribute"""
+ attribute
+ """
def __init__(
self, name, image_name="image", image_ct="imagecounter", **kw
diff --git a/lib/taurus/core/tango/starter.py b/lib/taurus/core/tango/starter.py
index a6d0fe3b..b64325e4 100644
--- a/lib/taurus/core/tango/starter.py
+++ b/lib/taurus/core/tango/starter.py
@@ -52,7 +52,8 @@ class Starter(object):
def __init__(self, ds_name):
"""
- :param ds_name: (str) Device Server name in the form "server/instance"
+ :param ds_name: Device Server name in the form "server/instance"
+ :type ds_name: str
"""
self.ds_name = ds_name
self.dserver_name = "dserver/%s" % ds_name
@@ -133,7 +134,7 @@ class Starter(object):
addNewDevice('sys/tg_test/foobar', klass='TangoTest')
:param klass: class name. If None passed, it defaults to the server
- name (without instance name)
+ name (without instance name)
"""
if device in self._addedDevices:
_log.warning("%s already added. Skipping" % device)
@@ -165,8 +166,9 @@ class Starter(object):
and then removes the server if it was registered by this starter
(or, if force is True, it removes the server in any case)
- :param force: (bool) force removing of the Server even if it was
- not registered within this starter
+ :param force: force removing of the Server even if it was not
+ registered within this starter
+ :type force: bool
"""
for device in self._addedDevices:
PyTango.Database().delete_device(device)
@@ -201,8 +203,10 @@ class ProcessStarter(Starter):
def __init__(self, execname, ds_name):
"""
- :param execname: (str) path to the executable to launch the server
- :param ds_name: (str) Device Server name in the form "server/instance"
+ :param execname: path to the executable to launch the server
+ :type execname: str
+ :param ds_name: Device Server name in the form "server/instance"
+ :type ds_name: str
"""
super(ProcessStarter, self).__init__(ds_name)
self.ds_instance = ds_name.split("/")[1]
diff --git a/lib/taurus/core/tango/tangoattribute.py b/lib/taurus/core/tango/tangoattribute.py
index 173ffb53..5af01a4a 100644
--- a/lib/taurus/core/tango/tangoattribute.py
+++ b/lib/taurus/core/tango/tangoattribute.py
@@ -24,7 +24,8 @@
##
#############################################################################
-"""This module contains all taurus tango attribute"""
+"""This module contains all taurus tango attribute
+"""
import re
import time
@@ -460,7 +461,8 @@ class TangoAttribute(TaurusAttribute):
def decode(self, attr_value):
"""Decodes a value that was received from PyTango into the expected
- representation"""
+ representation
+ """
if self._pytango_attrinfoex is None:
self.getAttributeInfoEx(cache=False)
self._decodeAttrInfoEx()
@@ -558,7 +560,7 @@ class TangoAttribute(TaurusAttribute):
cache was False.
:param cache: use cache value or make readout, eventually pass a
- cache's expiration period in milliseconds
+ cache's expiration period in milliseconds
:type cache: :obj:`bool` or :obj:`float`
:return: attribute value
:rtype: :obj:`~taurus.core.tango.TangoAttributeValue`
@@ -625,7 +627,8 @@ class TangoAttribute(TaurusAttribute):
def getAttributeProxy(self):
"""Convenience method that creates and returns a PyTango.AttributeProxy
- object"""
+ object
+ """
return PyTango.AttributeProxy(self.getFullName())
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
@@ -649,7 +652,8 @@ class TangoAttribute(TaurusAttribute):
"""Add a TaurusListener object in the listeners list.
If it is the first element and Polling is enabled starts the
polling mechanism.
- If the listener is already registered nothing happens."""
+ If the listener is already registered nothing happens.
+ """
listeners = self._listeners
initial_subscription_state = self.__subscription_state
@@ -684,7 +688,8 @@ class TangoAttribute(TaurusAttribute):
def removeListener(self, listener):
"""Remove a TaurusListener from the listeners list. If polling enabled
and it is the last element the stop the polling timer.
- If the listener is not registered nothing happens."""
+ If the listener is not registered nothing happens.
+ """
ret = TaurusAttribute.removeListener(self, listener)
if not ret:
@@ -720,7 +725,8 @@ class TangoAttribute(TaurusAttribute):
def _subscribeChangeEvents(self):
"""Enable subscription to the attribute events. If change events are
- not supported polling is activated"""
+ not supported polling is activated
+ """
if self.__chg_evt_id is not None:
self.warning(
@@ -912,12 +918,15 @@ class TangoAttribute(TaurusAttribute):
"""Handler of (non-configuration) events from the PyTango layer.
It handles the subscription and the (de)activation of polling
- :param event: (A PyTango event)
+ :param event:
+ :type event: A PyTango event
- :return: (evt_type, evt_value) Tuple containing the event type and the
- event value. evt_type is a `TaurusEventType` (or None to
- indicate that there should not be notification to listeners).
- evt_value is a TaurusValue, an Exception, or None.
+
+ :return: Tuple containing the event type and the event value. evt_type
+ is a `TaurusEventType` (or None to indicate that there should not
+ be notification to listeners). evt_value is a TaurusValue, an
+ Exception, or None.
+ :rtype: evt_type, evt_value
"""
if not event.err:
attr_value = self.decode(event.attr_value)
@@ -967,12 +976,15 @@ class TangoAttribute(TaurusAttribute):
def _pushConfEvent(self, event):
"""Handler of AttrConfEventData events from the PyTango layer.
- :param event: (PyTango.AttrConfEventData)
+ :param event:
+ :type event: PyTango.AttrConfEventData
+
- :return: (evt_type, evt_value) Tuple containing the event type and the
- event value. evt_type is a `TaurusEventType` (or None to
- indicate that there should not be notification to listeners).
- evt_value is a TaurusValue, an Exception, or None.
+ :return: Tuple containing the event type and the event value. evt_type
+ is a `TaurusEventType` (or None to indicate that there should not
+ be notification to listeners). evt_value is a TaurusValue, an
+ Exception, or None.
+ :rtype: evt_type, evt_value
"""
if not event.err:
# update conf-related attributes
@@ -1000,7 +1012,8 @@ class TangoAttribute(TaurusAttribute):
def getTangoWritable(self, cache=True):
"""like TaurusAttribute.isWritable(), but it returns a
- PyTango.AttrWriteType instead of a bool"""
+ PyTango.AttrWriteType instead of a bool
+ """
return self.tango_writable
def getLabel(self, cache=True):
@@ -1506,7 +1519,8 @@ class TangoAttributeEventListener(EventListener):
Note: Since this class stores for each event value the last timestamp when
it occured, it should only be used for events for which the event value
- domain (possible values) is limited and well known (ex: an enum)"""
+ domain (possible values) is limited and well known (ex: an enum)
+ """
def __init__(self, attr):
EventListener.__init__(self)
diff --git a/lib/taurus/core/tango/tangoconfiguration.py b/lib/taurus/core/tango/tangoconfiguration.py
index a03c01ee..8800b454 100644
--- a/lib/taurus/core/tango/tangoconfiguration.py
+++ b/lib/taurus/core/tango/tangoconfiguration.py
@@ -24,7 +24,8 @@
#############################################################################
"""[DEPRECATED SINCE v 4.0]
-This module contains all taurus tango attribute configuration"""
+This module contains all taurus tango attribute configuration
+"""
__all__ = ["TangoConfiguration"]
@@ -36,7 +37,8 @@ from taurus.core.taurusconfiguration import TaurusConfiguration
class TangoConfigValue(TaurusConfigValue):
"""A TaurusConfigValue specialization to decode PyTango.AttrInfoEx
- objects"""
+ objects
+ """
pass
diff --git a/lib/taurus/core/tango/tangodatabase.py b/lib/taurus/core/tango/tangodatabase.py
index 77438f73..6c8a3d21 100644
--- a/lib/taurus/core/tango/tangodatabase.py
+++ b/lib/taurus/core/tango/tangodatabase.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains all taurus tango authority"""
+"""This module contains all taurus tango authority
+"""
from collections.abc import Mapping
@@ -185,7 +186,8 @@ class TangoDevInfo(TangoInfo):
def state(self):
"""Overwrite state so it doesn't call 'alive()' since it can take
a long time for devices that are declared as exported but are in fact
- not running (crashed, network error, power cut, etc)"""
+ not running (crashed, network error, power cut, etc)
+ """
if not self._state is None:
return self._state
exported = self.exported()
@@ -452,15 +454,21 @@ class TangoDatabaseCache(object):
"""Returns a :class:`TangoDevInfo` object with information
about the given device name
- :param name: (str) the device name
+ :param name: the device name
+ :type name: str
+
- :return: (TangoDevInfo) information about the device"""
+ :return: information about the device
+ :rtype: TangoDevInfo
+ """
return self._devices.get(name)
def getDeviceNames(self):
"""Returns a list of registered device names
- :return: (sequence<str>) a sequence with all registered device names"""
+ :return: a sequence with all registered device names
+ :rtype: sequence<str>
+ """
if self._device_name_list is None:
self._device_name_list = sorted(
map(TangoDevInfo.name, self.devices().values())
@@ -477,7 +485,9 @@ class TangoDatabaseCache(object):
def getServerNames(self):
"""Returns a list of registered server names
- :return: (sequence<str>) a sequence with all registered server names"""
+ :return: a sequence with all registered server names
+ :rtype: sequence<str>
+ """
if self._server_name_list is None:
self._server_name_list = sorted(
map(TangoServInfo.name, self.servers().values())
@@ -487,7 +497,9 @@ class TangoDatabaseCache(object):
def getClassNames(self):
"""Returns a list of registered device classes
- :return: (sequence<str>) a sequence with all registered device classes"""
+ :return: a sequence with all registered device classes
+ :rtype: sequence<str>
+ """
if self._klass_name_list is None:
self._klass_name_list = sorted(
map(TangoDevClassInfo.name, self.klasses().values())
@@ -498,14 +510,18 @@ class TangoDatabaseCache(object):
"""Returns a tree container with all devices in three levels: domain,
family and member
- :return: (TangoDevTree) a tree containning all devices"""
+ :return: a tree containning all devices
+ :rtype: TangoDevTree
+ """
return self._device_tree
def serverTree(self):
"""Returns a tree container with all servers in two levels: server name
and server instance
- :return: (TangoServerTree) a tree containning all servers"""
+ :return: a tree containning all servers
+ :rtype: TangoServerTree
+ """
return self._server_tree
def servers(self):
@@ -585,12 +601,14 @@ class TangoDevTree(CaselessDict):
def getDomainDevices(self, domain):
"""Returns all devices under the given domain. Returns empty list if
- the domain doesn't exist or doesn't contain any devices"""
+ the domain doesn't exist or doesn't contain any devices
+ """
return list(self._devices.get(domain, {}).values())
def getFamilyDevices(self, domain, family):
"""Returns all devices under the given domain/family. Returns empty list if
- the domain/family doesn't exist or doesn't contain any devices"""
+ the domain/family doesn't exist or doesn't contain any devices
+ """
families = self.get(domain)
if families is None:
return
@@ -629,7 +647,8 @@ class TangoServerTree(dict):
def getServerNameInstances(self, serverName):
"""Returns all servers under the given serverName. Returns empty list if
- the server name doesn't exist or doesn't contain any instances"""
+ the server name doesn't exist or doesn't contain any instances
+ """
return list(self.get(serverName, {}).values())
@@ -810,33 +829,45 @@ class TangoAuthority(TaurusAuthority):
:class:`taurus.core.tango.TangoDevInfo` objects with information
about the given device name
- :param name: (str) the device name
+ :param name: the device name
+ :type name: str
+
- :return: (TangoDevInfo) information about the tango device"""
+ :return: information about the tango device
+ :rtype: TangoDevInfo
+ """
return self.cache().getDevice(name)
def getDeviceNames(self):
"""Returns a list of registered tango device names
- :return: (sequence<str>) a sequence with all registered tango device names"""
+ :return: a sequence with all registered tango device names
+ :rtype: sequence<str>
+ """
return self.cache().getDeviceNames()
def getAliasNames(self):
"""Returns a list of registered tango device alias
- :return: (sequence<str>) a sequence with all registered tango device alias"""
+ :return: a sequence with all registered tango device alias
+ :rtype: sequence<str>
+ """
return self.cache().getAliasNames()
def getServerNames(self):
"""Returns a list of registered tango device servers in format<name>/<instance>
- :return: (sequence<str>) a sequence with all registered tango device servers"""
+ :return: a sequence with all registered tango device servers
+ :rtype: sequence<str>
+ """
return self.cache().getServerNames()
def getClassNames(self):
"""Returns a list of registered tango device classes
- :return: (sequence<str>) a sequence with all registered tango device classes"""
+ :return: a sequence with all registered tango device classes
+ :rtype: sequence<str>
+ """
return self.cache().getClassNames()
def getDeviceDomainNames(self):
@@ -861,7 +892,9 @@ class TangoAuthority(TaurusAuthority):
"""Returns a tree container with all devices in three levels : domain,
family and member
- :return: (TangoDevTree) a tree containning all devices"""
+ :return: a tree containning all devices
+ :rtype: TangoDevTree
+ """
return self.cache().deviceTree()
def getElementAlias(self, full_name):
diff --git a/lib/taurus/core/tango/tangodevice.py b/lib/taurus/core/tango/tangodevice.py
index d02d69aa..160a3a54 100644
--- a/lib/taurus/core/tango/tangodevice.py
+++ b/lib/taurus/core/tango/tangodevice.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module defines the TangoDevice object"""
+"""This module defines the TangoDevice object
+"""
import time
from PyTango import DeviceProxy, DevFailed, LockerInfo, DevState
@@ -57,7 +58,8 @@ def __init__(self):
class TangoDevice(TaurusDevice):
"""A Device object representing an abstraction of the PyTango.DeviceProxy
- object in the taurus.core.tango scheme"""
+ object in the taurus.core.tango scheme
+ """
# helper class property that stores a reference to the corresponding
# factory
@@ -97,13 +99,15 @@ class TangoDevice(TaurusDevice):
def __getitem__(self, key):
"""read attribute value using key-indexing syntax (e.g. as in a dict)
- on the device"""
+ on the device
+ """
attr = self.getAttribute(key)
return attr.read()
def __setitem__(self, key, value):
"""set attribute value using key-indexing syntax (e.g. as in a dict)
- on the device"""
+ on the device
+ """
attr = self.getAttribute(key)
return attr.write(value)
@@ -144,10 +148,13 @@ class TangoDevice(TaurusDevice):
attribute for diagnosis of the current state. It supports a "cache"
kwarg
- :param cache: (bool) If True (default), cache will be used when reading
- the state attribute of this device
+ :param cache: If True (default), cache will be used when reading the
+ state attribute of this device
+ :type cache: bool
- :return: (TaurusDevState)
+
+ :return:
+ :rtype: TaurusDevState
"""
self._deviceState = TaurusDevState.NotReady
try:
@@ -335,7 +342,8 @@ class TangoDevice(TaurusDevice):
def __decode(self, event_value):
"""Decode events from the state attribute into TangoAttrValues whose
- rvalue is the Device state"""
+ rvalue is the Device state
+ """
from taurus.core.tango.tangoattribute import TangoAttrValue
if isinstance(event_value, TangoAttrValue): # for change events (&co)
diff --git a/lib/taurus/core/tango/tangofactory.py b/lib/taurus/core/tango/tangofactory.py
index 03c88735..655c7607 100644
--- a/lib/taurus/core/tango/tangofactory.py
+++ b/lib/taurus/core/tango/tangofactory.py
@@ -106,7 +106,8 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
def init(self, *args, **kwargs):
"""Singleton instance initialization.
- **For internal usage only**"""
+ **For internal usage only**
+ """
name = self.__class__.__name__
self.call__init__(Logger, name)
self.call__init__(TaurusFactory)
@@ -164,22 +165,25 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
def getExistingAttributes(self):
"""Returns a new dictionary will all registered attributes on this factory
- :return: dictionary will all registered attributes on this factory
- :rtype: dict"""
+ :return: dictionary will all registered attributes on this factory
+ :rtype: dict
+ """
return dict(self.tango_attrs)
def getExistingDevices(self):
"""Returns a new dictionary will all registered devices on this factory
- :return: dictionary will all registered devices on this factory
- :rtype: dict"""
+ :return: dictionary will all registered devices on this factory
+ :rtype: dict
+ """
return dict(self.tango_devs)
def getExistingDatabases(self):
"""Returns a new dictionary will all registered databases on this factory
- :return: dictionary will all registered databases on this factory
- :rtype: dict"""
+ :return: dictionary will all registered databases on this factory
+ :rtype: dict
+ """
return dict(self.tango_db)
def set_default_tango_host(self, tango_host):
@@ -189,10 +193,9 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
.. note:: Calling this method also clears the device alias cache.
- :param tango_host: (str) the new tango host. It accepts any valid Tango
- authority name or None to use the defined by
- $TANGO_HOST env. var.
-
+ :param tango_host: the new tango host. It accepts any valid Tango
+ authority name or None to use the defined by $TANGO_HOST env. var.
+ :type tango_host: str
"""
# Translate to Authority URI
if tango_host and "//" not in tango_host:
@@ -229,9 +232,10 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
def registerAttributeClass(self, attr_name, attr_klass):
"""Registers a new attribute class for the attribute name.
- :param attr_name: (str) attribute name
- :param attr_klass: (taurus.core.tango.TangoAttribute) the new class that
- will handle the attribute
+ :param attr_name: attribute name
+ :type attr_name: str
+ :param attr_klass: the new class that will handle the attribute
+ :type attr_klass: taurus.core.tango.TangoAttribute
"""
self.tango_attr_klasses[attr_name] = attr_klass
@@ -240,7 +244,8 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
If no class was registered before for the given attribute, this call
as no effect
- :param attr_name: (str) attribute name
+ :param attr_name: attribute name
+ :type attr_name: str
"""
if attr_name in self.tango_attr_klasses:
del self.tango_attr_klasses[attr_name]
@@ -248,9 +253,11 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
def registerDeviceClass(self, dev_klass_name, dev_klass):
"""Registers a new python class to handle tango devices of the given tango class name
- :param dev_klass_name: (str) tango device class name
- :param dev_klass: (taurus.core.tango.TangoDevice) the new class that will
- handle devices of the given tango class name
+ :param dev_klass_name: tango device class name
+ :type dev_klass_name: str
+ :param dev_klass: the new class that will handle devices of the given
+ tango class name
+ :type dev_klass: taurus.core.tango.TangoDevice
"""
self.tango_dev_klasses[dev_klass_name] = dev_klass
@@ -259,7 +266,8 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
If no class was registered before for the given attribute, this call
as no effect
- :param dev_klass_name: (str) tango device class name
+ :param dev_klass_name: tango device class name
+ :type dev_klass_name: str
"""
if dev_klass_name in self.tango_dev_klasses:
del self.tango_dev_klasses[dev_klass_name]
@@ -275,11 +283,15 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
If the corresponding authority object already exists, the existing
instance is returned. Otherwise a new instance is stored and returned.
- :param name: (str) database name string alias. If None, the
- default database is used
+ :param name: database name string alias. If None, the default database
+ is used
+ :type name: str
+
- :return: (taurus.core.tangodatabase.TangoAuthority) database object
- :raise: (taurus.core.taurusexception.TaurusException) if the given alias is invalid.
+ :return: database object :raise:
+ (taurus.core.taurusexception.TaurusException) if the given alias is
+ invalid.
+ :rtype: taurus.core.tangodatabase.TangoAuthority
"""
ret = None
if name is None:
@@ -331,17 +343,19 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
If the corresponding device already exists, the existing instance
is returned. Otherwise a new instance is stored and returned.
- :param dev_name: (str) tango device name or tango alias for the
- device. It must be a valid Tango device URI.
- If authority is not explicit, the default Tango
- Database will be used
- :param create_if_needed: (bool) If True, the Device is created if it
- did not exist previously. If False, it
- returns None if it did not exist
-
- :return: (taurus.core.tango.TangoDevice) a device object
- :raise: (taurus.core.taurusexception.TaurusException) if the given
- dev_name is invalid.
+ :param dev_name: tango device name or tango alias for the device. It
+ must be a valid Tango device URI. If authority is not explicit, the
+ default Tango Database will be used
+ :type dev_name: str
+ :param create_if_needed: If True, the Device is created if it did not
+ exist previously. If False, it returns None if it did not exist
+ :type create_if_needed: bool
+
+
+ :return: a device object :raise:
+ (taurus.core.taurusexception.TaurusException) if the given dev_name
+ is invalid.
+ :rtype: taurus.core.tango.TangoDevice
"""
d = self.tango_devs.get(dev_name)
if d is None:
@@ -391,13 +405,15 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
If the corresponding attribute already exists, the existing instance
is returned. Otherwise a new instance is stored and returned.
- :param attr_name: (str) a valid attribute name URI
- :param create_if_needed: (bool) If True, the Attribute is created if
- it did not already exist. If False,
- None is returned if it did not exist
- :return: (taurus.core.tangoattribute.TangoAttribute) attribute object
- :raise: (taurus.core.taurusexception.TaurusException) if the given
- alias is invalid.
+ :param attr_name: a valid attribute name URI
+ :type attr_name: str
+ :param create_if_needed: If True, the Attribute is created if it did
+ not already exist. If False, None is returned if it did not exist
+ :type create_if_needed: bool
+ :return: attribute object :raise:
+ (taurus.core.taurusexception.TaurusException) if the given alias is
+ invalid.
+ :rtype: taurus.core.tangoattribute.TangoAttribute
"""
attr = self.tango_attrs.get(attr_name)
if attr is not None:
@@ -456,9 +472,13 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
If the corresponding attribute info already exists, the existing information
is returned. Otherwise a new information instance is stored and returned.
- :param full_attr_name: (str) attribute name in format: <tango device name>'/'<attribute name>
+ :param full_attr_name: attribute name in format: <tango device
+ name>'/'<attribute name>
+ :type full_attr_name: str
+
- :return: (taurus.core.tango.TangoConfiguration) configuration object
+ :return: configuration object
+ :rtype: taurus.core.tango.TangoConfiguration
"""
self.deprecated("Use getConfiguration(full_attr_name) instead")
attr = self.getAttribute(full_attr_name)
@@ -470,10 +490,12 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
If the corresponding configuration already exists, the existing instance
is returned. Otherwise a new instance is stored and returned.
- :param param: (taurus.core.taurusattribute.TaurusAttribute or str)
- attribute object or full configuration name
+ :param param: attribute object or full configuration name
+ :type param: taurus.core.taurusattribute.TaurusAttribute or str
- :return: (taurus.core.tango.TangoAttribute) configuration object
+
+ :return: configuration object
+ :rtype: taurus.core.tango.TangoAttribute
"""
if isinstance(param, str):
return self.getAttribute(param)
@@ -553,7 +575,8 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
def removeExistingDevice(self, dev_or_dev_name):
"""Removes a previously registered device.
- :param dev_or_dev_name: (str or TangoDevice) device name or device object
+ :param dev_or_dev_name: device name or device object
+ :type dev_or_dev_name: str or TangoDevice
"""
if isinstance(dev_or_dev_name, _Device):
dev = dev_or_dev_name
@@ -572,7 +595,8 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
def removeExistingAttribute(self, attr_or_attr_name):
"""Removes a previously registered attribute.
- :param attr_or_attr_name: (str or TangoAttribute) attribute name or attribute object
+ :param attr_or_attr_name: attribute name or attribute object
+ :type attr_or_attr_name: str or TangoAttribute
"""
if isinstance(attr_or_attr_name, _Attribute):
attr = attr_or_attr_name
@@ -588,7 +612,8 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
def isPollingEnabled(self):
"""Tells if the local tango polling is enabled
- :return: (bool) wheter or not the polling is enabled
+ :return: wheter or not the polling is enabled
+ :rtype: bool
"""
return self._polling_enabled
@@ -638,7 +663,8 @@ class TangoFactory(Singleton, TaurusFactory, Logger):
def setOperationMode(self, mode):
"""Deprecated. setOperationMode(OperationMode mode) -> None
- Sets the operation mode for the Tango system."""
+ Sets the operation mode for the Tango system.
+ """
dep = "setOperationMode"
rel = "Taurus4"
dbg_msg = "Don't use this method"
diff --git a/lib/taurus/core/tango/tangovalidator.py b/lib/taurus/core/tango/tangovalidator.py
index 8aba1473..8ae0591b 100644
--- a/lib/taurus/core/tango/tangovalidator.py
+++ b/lib/taurus/core/tango/tangovalidator.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the base taurus name validator classes"""
+"""This module contains the base taurus name validator classes
+"""
__all__ = [
"TangoAuthorityNameValidator",
diff --git a/lib/taurus/core/tango/test/nodb.py b/lib/taurus/core/tango/test/nodb.py
index b6762a07..4bf71959 100644
--- a/lib/taurus/core/tango/test/nodb.py
+++ b/lib/taurus/core/tango/test/nodb.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Module containing base classes for database-less tango tests"""
+"""Module containing base classes for database-less tango tests
+"""
import pytest
@@ -64,7 +65,6 @@ def nodb_dev():
import taurus
d = taurus.Device(nodb_dev)
assert d["string_scalar"].rvalue == "hello world"
-
"""
with NamedDeviceTestContext(
TangoSchemeTest, process=True, timeout=15
diff --git a/lib/taurus/core/tango/test/res/TangoSchemeTest.py b/lib/taurus/core/tango/test/res/TangoSchemeTest.py
index 3e0525dd..6b1d1049 100755
--- a/lib/taurus/core/tango/test/res/TangoSchemeTest.py
+++ b/lib/taurus/core/tango/test/res/TangoSchemeTest.py
@@ -43,7 +43,7 @@ from threading import Thread
"""
We should check tango version
-If lower than 9.2.0 then DeviceMeta is a function and we can not use directly.
+If lower than 9.2.0 then DeviceMeta is a function and we can not use directly.
"""
if LooseVersion(tango.__version__) < LooseVersion("9.2.1"):
diff --git a/lib/taurus/core/tango/test/test_tangoattribute.py b/lib/taurus/core/tango/test/test_tangoattribute.py
index bb603d0a..1fe0b4aa 100644
--- a/lib/taurus/core/tango/test/test_tangoattribute.py
+++ b/lib/taurus/core/tango/test/test_tangoattribute.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.tango.test.test_tangovalidator..."""
+"""Test for taurus.core.tango.test.test_tangovalidator...
+"""
# __all__ = []
diff --git a/lib/taurus/core/tango/test/test_tangofactory.py b/lib/taurus/core/tango/test/test_tangofactory.py
index 013b717a..62b3dae6 100644
--- a/lib/taurus/core/tango/test/test_tangofactory.py
+++ b/lib/taurus/core/tango/test/test_tangofactory.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Tests for taurus.core.tango.tangofactory"""
+"""Tests for taurus.core.tango.tangofactory
+"""
import time
diff --git a/lib/taurus/core/tango/test/test_tangovalidator.py b/lib/taurus/core/tango/test/test_tangovalidator.py
index 3194bfd3..29cd54cd 100644
--- a/lib/taurus/core/tango/test/test_tangovalidator.py
+++ b/lib/taurus/core/tango/test/test_tangovalidator.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.tango.test.test_tangovalidator..."""
+"""Test for taurus.core.tango.test.test_tangovalidator...
+"""
# __all__ = []
diff --git a/lib/taurus/core/tango/test/tgtestds.py b/lib/taurus/core/tango/test/tgtestds.py
index e039ec07..f1c5a073 100644
--- a/lib/taurus/core/tango/test/tgtestds.py
+++ b/lib/taurus/core/tango/test/tgtestds.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Module containing base classes for using the TangoSchemeTest DS in tests"""
+"""Module containing base classes for using the TangoSchemeTest DS in tests
+"""
import PyTango
from taurus.core.tango.starter import ProcessStarter
@@ -51,7 +52,6 @@ def taurus_test_ds():
import taurus
d = taurus.Device(taurus_test_ds)
assert d["string_scalar"].rvalue == "hello world"
-
"""
deprecated(dep="taurus_test_ds fixture", alt="nodb_dev", rel="4.7.1")
ds_name = "TangoSchemeTest/unittest/temp-{:08d}".format(
@@ -77,7 +77,8 @@ def taurus_test_ds():
class TangoSchemeTestLauncher(object):
"""A base class for TestCase classes wishing to start a TangoSchemeTest.
- Use it as a mixin class"""
+ Use it as a mixin class
+ """
deprecated(
dep="TangoSchemeTestLauncher",
diff --git a/lib/taurus/core/tango/util/__init__.py b/lib/taurus/core/tango/util/__init__.py
index 5989e6c4..fe234d6e 100644
--- a/lib/taurus/core/tango/util/__init__.py
+++ b/lib/taurus/core/tango/util/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""The sardana package. It contains specific part of sardana"""
+"""The sardana package. It contains specific part of sardana
+"""
from .formatter import tangoFormatter
diff --git a/lib/taurus/core/tango/util/formatter.py b/lib/taurus/core/tango/util/formatter.py
index 176f26b9..cd28d4b5 100644
--- a/lib/taurus/core/tango/util/formatter.py
+++ b/lib/taurus/core/tango/util/formatter.py
@@ -33,9 +33,11 @@ def tangoFormatter(dtype=None, **kwargs):
The tango formatter callable. Returns a format string based on
the `format` Tango Attribute configuration (Display.Format in Tango DB)
- :param dtype: (type) type of the value object
+ :param dtype: type of the value object
+ :type dtype: type
:param kwargs: other keyword arguments (ignored)
+
:return: the string formatting
"""
if dtype is Quantity:
diff --git a/lib/taurus/core/tango/util/tango_taurus.py b/lib/taurus/core/tango/util/tango_taurus.py
index 616bbad7..f36945e1 100644
--- a/lib/taurus/core/tango/util/tango_taurus.py
+++ b/lib/taurus/core/tango/util/tango_taurus.py
@@ -23,7 +23,8 @@
##
##############################################################################
-"""Utility functions to convert between tango and Taurus types"""
+"""Utility functions to convert between tango and Taurus types
+"""
import PyTango
diff --git a/lib/taurus/core/taurusattribute.py b/lib/taurus/core/taurusattribute.py
index e84bc1bf..ec6d3c96 100644
--- a/lib/taurus/core/taurusattribute.py
+++ b/lib/taurus/core/taurusattribute.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the base class for a taurus attribute"""
+"""This module contains the base class for a taurus attribute
+"""
__all__ = ["TaurusAttribute"]
@@ -196,8 +197,9 @@ class TaurusAttribute(TaurusModel):
"""Enable polling. See :meth:`isPollingEnabled` for clarification of
what enabled polling means.
- :param force: (bool) True also activates polling
- (see: :meth:`activatePolling`)
+ :param force: True also activates polling (see:
+ :meth:`activatePolling`)
+ :type force: bool
"""
self.__enable_polling = True
self.__forced_polling = force
@@ -222,7 +224,9 @@ class TaurusAttribute(TaurusModel):
Enabled polling does not mean that it is active - periodically poll
the attribute. By default the attribute creation enables polling.
- :return: (bool) whether polling is enabled
+ :return: whether polling is enabled
+ :rtype: bool
+
:see: :meth:`enablePolling`, :meth:`disablePolling`
"""
@@ -245,7 +249,9 @@ class TaurusAttribute(TaurusModel):
a periodic timer poll the attribute. By default the attribute creation
does not activate polling.
- :return: (bool) whether polling is active
+ :return: whether polling is active
+ :rtype: bool
+
:see: :meth:`activatePolling`, :meth:`disablePolling`
"""
diff --git a/lib/taurus/core/taurusauthority.py b/lib/taurus/core/taurusauthority.py
index acb68103..aca7e8e7 100644
--- a/lib/taurus/core/taurusauthority.py
+++ b/lib/taurus/core/taurusauthority.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the base class for a taurus database"""
+"""This module contains the base class for a taurus database
+"""
from .taurusbasetypes import TaurusElementType
from .taurusmodel import TaurusModel
diff --git a/lib/taurus/core/taurusconfiguration.py b/lib/taurus/core/taurusconfiguration.py
index 668e013c..fb03b650 100644
--- a/lib/taurus/core/taurusconfiguration.py
+++ b/lib/taurus/core/taurusconfiguration.py
@@ -25,7 +25,8 @@
#############################################################################
"""[DEPRECATED since taurus v4]
-This module contains the base class for a taurus attribute configuration"""
+This module contains the base class for a taurus attribute configuration
+"""
from .taurusmodel import TaurusModel
from .util.log import taurus4_deprecation
diff --git a/lib/taurus/core/taurusdatabase.py b/lib/taurus/core/taurusdatabase.py
index f9e832cd..514f50a7 100644
--- a/lib/taurus/core/taurusdatabase.py
+++ b/lib/taurus/core/taurusdatabase.py
@@ -24,7 +24,8 @@
#############################################################################
"""Do not use. Deprecated. Backwards compatibility module for transition from
-TaurusDatabase to TaurusAuthority"""
+TaurusDatabase to TaurusAuthority
+"""
from logging import warning
diff --git a/lib/taurus/core/taurusdevice.py b/lib/taurus/core/taurusdevice.py
index 3d668c03..87ee6df3 100644
--- a/lib/taurus/core/taurusdevice.py
+++ b/lib/taurus/core/taurusdevice.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the base class for a taurus device"""
+"""This module contains the base class for a taurus device
+"""
__all__ = ["TaurusDevice"]
@@ -37,7 +38,8 @@ class TaurusDevice(TaurusModel):
"""A Device object. Different schemes may assign different roles, but
in general it is a parent of Taurus Attribute objects and a child
- of a Taurus Authority"""
+ of a Taurus Authority
+ """
_description = "A Taurus Device"
@@ -69,7 +71,8 @@ class TaurusDevice(TaurusModel):
Subclasses of TaurusDevice may reimplement it to return other
:class:`taurus.core.TaurusDevState` enumeration values.
- :return: (TaurusDevState) `TaurusDevState.Ready`
+ :return: `TaurusDevState.Ready`
+ :rtype: TaurusDevState
"""
return TaurusDevState.Ready
@@ -121,7 +124,8 @@ class TaurusDevice(TaurusModel):
def poll(self, attrs, asynch=False, req_id=None):
"""Polling certain attributes of the device. This default
- implementation simply polls each attribute one by one"""
+ implementation simply polls each attribute one by one
+ """
# asynchronous requests are not supported. If asked to do it,
# just return an ID of 1 and in the reply (req_id != None) we do a
diff --git a/lib/taurus/core/taurusexception.py b/lib/taurus/core/taurusexception.py
index cd64cb2b..31ffd649 100644
--- a/lib/taurus/core/taurusexception.py
+++ b/lib/taurus/core/taurusexception.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the taurus base exception classes"""
+"""This module contains the taurus base exception classes
+"""
__all__ = ["TaurusException", "DoubleRegistration"]
diff --git a/lib/taurus/core/taurusfactory.py b/lib/taurus/core/taurusfactory.py
index f66e9f48..7984eadd 100644
--- a/lib/taurus/core/taurusfactory.py
+++ b/lib/taurus/core/taurusfactory.py
@@ -53,7 +53,6 @@
- The path component, if present, must start by a single slash ('/') (see
<https://tools.ietf.org/html/rfc3986#section-3.3>)
-
"""
import atexit
@@ -115,14 +114,16 @@ class TaurusFactory(object):
def setSerializationMode(self, mode):
"""Sets the serialization mode for the system.
- :param mode: (TaurusSerializationMode) the new serialization mode
+ :param mode: the new serialization mode
+ :type mode: TaurusSerializationMode
"""
self._serialization_mode = mode
def getSerializationMode(self):
"""Gives the serialization operation mode.
- :return: (TaurusSerializationMode) the current serialization mode
+ :return: the current serialization mode
+ :rtype: TaurusSerializationMode
"""
return self._serialization_mode
@@ -136,7 +137,9 @@ class TaurusFactory(object):
If the corresponding authority already exists, the existing instance
is returned. Otherwise a new instance is stored and returned.
- :param name: (str) authority name
+ :param name: authority name
+ :type name: str
+
:return: a taurus.core.taurusauthority.TaurusAuthority object
:raises: :TaurusException: if the given name is invalid.
@@ -163,7 +166,9 @@ class TaurusFactory(object):
If the corresponding device already exists, the existing instance
is returned. Otherwise a new instance is stored and returned.
- :param name: (str) device name
+ :param name: device name
+ :type name: str
+
:return: a taurus.core.taurusdevice.TaurusDevice object
:raises: :TaurusException: if the given name is invalid.
@@ -199,7 +204,9 @@ class TaurusFactory(object):
If the corresponding attribute already exists, the existing instance
is returned. Otherwise a new instance is stored and returned.
- :param name: (str) attribute name
+ :param name: attribute name
+ :type name: str
+
:return: a taurus.core.taurusattribute.TaurusAttribute object
:raises: :TaurusException: if the given name is invalid.
@@ -277,9 +284,12 @@ class TaurusFactory(object):
def supportsScheme(self, scheme):
"""Returns whether the given scheme is supported by this factory
- :param scheme: (str) the name of the schem to be checked
+ :param scheme: the name of the schem to be checked
+ :type scheme: str
+
- :return: (bool) True if the scheme is supported (False otherwise)
+ :return: True if the scheme is supported (False otherwise)
+ :rtype: bool
"""
return scheme in self.schemes
@@ -331,7 +341,8 @@ class TaurusFactory(object):
def isPollingEnabled(self):
"""Tells if the Taurus polling is enabled
- :return: (bool) whether or not the polling is enabled
+ :return: whether or not the polling is enabled
+ :rtype: bool
"""
return self._polling_enabled
@@ -355,10 +366,12 @@ class TaurusFactory(object):
"""Activates the polling (client side) for the given attribute with the
given period (seconds).
- :param attribute: (taurus.core.taurusattribute.TaurusAttribute)
- the attribute to be added
- :param period: (float) polling period (in seconds)
- :param unsubscribe_evts: (bool) whether or not to unsubscribe from events
+ :param attribute: the attribute to be added
+ :type attribute: taurus.core.taurusattribute.TaurusAttribute
+ :param period: polling period (in seconds)
+ :type period: float
+ :param unsubscribe_evts: whether or not to unsubscribe from events
+ :type unsubscribe_evts: bool
"""
tmr = self.polling_timers.get(period, TaurusPollingTimer(period))
self.polling_timers[period] = tmr
@@ -368,8 +381,8 @@ class TaurusFactory(object):
"""Deactivate the polling (client side) for the given attribute. If the
polling of the attribute was not previously enabled, nothing happens.
- :param attribute: (taurus.core.taurusattribute.TaurusAttribute)
- the attribute to be removed
+ :param attribute: the attribute to be removed
+ :type attribute: taurus.core.taurusattribute.TaurusAttribute
"""
timers = dict(self.polling_timers)
for period, timer in timers.items():
@@ -397,10 +410,13 @@ class TaurusFactory(object):
If a given schema requires a different ordering, reimplement this method
- :param name: (str) taurus model name
+ :param name: taurus model name
+ :type name: str
+
- :return: (list<TaurusElementType.element>) where element can be one of:
- `Attribute`, `Device` or `Authority`
+ :return: where element can be one of: `Attribute`, `Device` or
+ `Authority`
+ :rtype: list<TaurusElementType.element>
"""
ret = []
if self.getAttributeNameValidator().isValid(name, strict=strict):
@@ -439,11 +455,13 @@ class TaurusFactory(object):
(...)
- :param absolute_name: (str) the object absolute name string
+ :param absolute_name: the object absolute name string
+ :type absolute_name: str
- :return: (taurus.core.taurusmodel.TaurusModel or None) a TaurusModel
- class derived type or None if the name is not valid
+ :return: a TaurusModel class derived type or None if the name is not
+ valid
+ :rtype: taurus.core.taurusmodel.TaurusModel or None
"""
try:
elementTypesMap = self.elementTypesMap
diff --git a/lib/taurus/core/taurushelper.py b/lib/taurus/core/taurushelper.py
index 2cca77b0..b0dff0b4 100644
--- a/lib/taurus/core/taurushelper.py
+++ b/lib/taurus/core/taurushelper.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""a list of helper methods"""
+"""a list of helper methods
+"""
import re
from taurus import tauruscustomsettings
@@ -134,13 +135,14 @@ def log_dependencies():
def getSchemeFromName(name, implicit=True):
"""Return the scheme from a taurus name.
- :param name: (str) taurus model name URI.
- :param implicit: (bool) controls whether to return the default scheme
- (if implicit is True -default-) or None (if implicit is
- False) in case `model` does not contain the scheme name
- explicitly. The default scheme may be defined in
- :ref:`tauruscustomsettings` ('tango' is assumed if
- not defined)
+ :param name: taurus model name URI.
+ :type name: str
+ :param implicit: controls whether to return the default scheme (if implicit
+ is True -default-) or None (if implicit is False) in case `model` does
+ not contain the scheme name explicitly. The default scheme may be
+ defined in :ref:`tauruscustomsettings` ('tango' is assumed if not
+ defined)
+ :type implicit: bool
"""
m = __SCHEME_RE.match(name)
if m is not None:
@@ -169,10 +171,12 @@ def makeSchemeExplicit(name, default=None):
"""return the name guaranteeing that the scheme is present. If name already
contains the scheme, it is returned unchanged.
- :param name: (str) taurus model name URI.
- :param default: (str) The default scheme to use. If no default is passed,
- the one defined in tauruscustomsettings.DEFAULT_SCHEME is
- used.
+ :param name: taurus model name URI.
+ :type name: str
+ :param default: The default scheme to use. If no default is passed, the one
+ defined in tauruscustomsettings.DEFAULT_SCHEME is used.
+ :type default: str
+
:return: the name with the explicit scheme.
"""
@@ -190,13 +194,15 @@ def getValidTypesForName(name, strict=None):
model name (while in many cases a name may only be valid for one
element type, this is not necessarily true in general)
- :param name: (str) taurus model name
- :param strict: (bool) If True, names that are not RFC3986-compliant but
- which would be accepted for backwards compatibility are
- considered valid.
+ :param name: taurus model name
+ :type name: str
+ :param strict: If True, names that are not RFC3986-compliant but which
+ would be accepted for backwards compatibility are considered valid.
+ :type strict: bool
+
- :return: (list<TaurusElementType.element>) where element can be one of:
- `Attribute`, `Device` or `Authority`
+ :return: where element can be one of: `Attribute`, `Device` or `Authority`
+ :rtype: list<TaurusElementType.element>
"""
try:
factory = Factory(scheme=getSchemeFromName(name))
@@ -214,16 +220,19 @@ def isValidName(name, etypes=None, strict=None):
isValidName('tango:foo')--> True
isValidName('tango:a/b/c', [TaurusElementType.Attribute]) --> False
- :param name: (str) the string to be checked for validity
- :param etypes: (seq<TaurusElementType>) if given, names will only be
- considered valid if they represent one of the given
- element types. Supported element types are:
- `Attribute`, `Device` and `Authority`
- :param strict: (bool) If True, names that are not RFC3986-compliant but
- which would be accepted for backwards compatibility are
- considered valid.
+ :param name: the string to be checked for validity
+ :type name: str
+ :param etypes: if given, names will only be considered valid if they
+ represent one of the given element types. Supported element types are:
+ `Attribute`, `Device` and `Authority`
+ :type etypes: seq<TaurusElementType>
+ :param strict: If True, names that are not RFC3986-compliant but which
+ would be accepted for backwards compatibility are considered valid.
+ :type strict: bool
+
- :return: (bool)
+ :return:
+ :rtype: bool
"""
validtypes = getValidTypesForName(name, strict=strict)
if etypes is None:
@@ -261,7 +270,8 @@ def Factory(scheme=None):
manager = taurus.core.taurusmanager.TaurusManager()
factory = manager.getFactory(scheme)
- :param scheme: a string representing the scheme. Default value is None meaning ``tango`` scheme
+ :param scheme: a string representing the scheme. Default value is None
+ meaning ``tango`` scheme
:type scheme: str
:return: a taurus factory
:rtype: :class:`taurus.core.taurusfactory.TaurusFactory`
@@ -391,8 +401,8 @@ def Authority(name=None):
db = factory.getAuthority(dname)
:param name: authority name. If None (default) it will return the default
- authority of the default scheme. For example, if the default
- scheme is tango, it will return the default TANGO_HOST database
+ authority of the default scheme. For example, if the default scheme is
+ tango, it will return the default TANGO_HOST database
:type name: str or None
:return: a taurus authority
:rtype: :class:`taurus.core.taurusauthority.TaurusAuthority`
diff --git a/lib/taurus/core/tauruslistener.py b/lib/taurus/core/tauruslistener.py
index f72f9bf5..50cbf876 100644
--- a/lib/taurus/core/tauruslistener.py
+++ b/lib/taurus/core/tauruslistener.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the taurus base listeners classes"""
+"""This module contains the taurus base listeners classes
+"""
from .util.log import Logger
diff --git a/lib/taurus/core/taurusmanager.py b/lib/taurus/core/taurusmanager.py
index bd96a1f2..f62033a6 100644
--- a/lib/taurus/core/taurusmanager.py
+++ b/lib/taurus/core/taurusmanager.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the taurus base manager class"""
+"""This module contains the taurus base manager class
+"""
import os
import atexit
@@ -74,7 +75,8 @@ class TaurusManager(Singleton, Logger):
def init(self, *args, **kwargs):
"""Singleton instance initialization.
- For internal usage only. Do **NOT** call this method directly"""
+ For internal usage only. Do **NOT** call this method directly
+ """
self._state = ManagerState.UNINITIALIZED
self.call__init__(Logger)
self.reInit()
@@ -136,12 +138,16 @@ class TaurusManager(Singleton, Logger):
):
"""Enqueue a job (callable) to the queue. The new job will be
processed by a separate thread
- :param job: (callable) a callable object
- :param callback: (callable) called after the job has been processed
- :param job_args: (sequence) positional arguments passed to the job
- :param job_kwargs: (dict) keyword arguments passed to the job
- :param serialization_mode: (TaurusSerializationMode) serialization
- mode
+ :param job: a callable object
+ :type job: callable
+ :param callback: called after the job has been processed
+ :type callback: callable
+ :param job_args: positional arguments passed to the job
+ :type job_args: sequence
+ :param job_kwargs: keyword arguments passed to the job
+ :type job_kwargs: dict
+ :param serialization_mode: serialization mode
+ :type serialization_mode: TaurusSerializationMode
"""
if job_kwargs is None:
job_kwargs = {}
@@ -181,19 +187,25 @@ class TaurusManager(Singleton, Logger):
def setSerializationMode(self, mode):
"""Sets the serialization mode for the system.
- :param mode: (TaurusSerializationMode) the new serialization mode"""
+ :param mode: the new serialization mode
+ :type mode: TaurusSerializationMode
+ """
self._serialization_mode = mode
def getSerializationMode(self):
"""Gives the serialization operation mode.
- :return: (TaurusSerializationMode) the current serialization mode"""
+ :return: the current serialization mode
+ :rtype: TaurusSerializationMode
+ """
return self._serialization_mode
def setOperationMode(self, mode):
"""Deprecated. Sets the operation mode for the system.
- :param mode: (OperationMode) the new operation mode"""
+ :param mode: the new operation mode
+ :type mode: OperationMode
+ """
dep = "setOperationMode"
rel = "Taurus4"
dbg_msg = "Don't use this method"
@@ -203,7 +215,9 @@ class TaurusManager(Singleton, Logger):
def getOperationMode(self):
"""Deprecated. Gives the current operation mode.
- :return: (OperationMode) the current operation mode"""
+ :return: the current operation mode
+ :rtype: OperationMode
+ """
dep = "getOperationMode"
rel = "Taurus4"
dbg_msg = "Don't use this method"
@@ -214,14 +228,16 @@ class TaurusManager(Singleton, Logger):
def getDefaultFactory(self):
"""Gives the default factory.
- :return: (taurus.core.taurusfactory.TaurusFactory) the default taurus factory
+ :return: the default taurus factory
+ :rtype: taurus.core.taurusfactory.TaurusFactory
"""
return self.getPlugins().get(self.default_scheme, None)
def getPlugins(self):
"""Gives the information about the existing plugins
- :return: (dict<str, class taurus.core.taurusfactory.TaurusFactory>)the list of plugins
+ :return: the list of plugins
+ :rtype: dict<str, class taurus.core.taurusfactory.TaurusFactory>
"""
if self._plugins is None:
self._plugins = self._build_plugins()
@@ -230,9 +246,11 @@ class TaurusManager(Singleton, Logger):
def getFactory(self, scheme=None):
"""Gives the factory class object supporting the given scheme
- :param scheme: (str or None) the scheme. If None the default scheme is used
- :return: (taurus.core.taurusfactory.TaurusFactory or None) the factory class object for the
- given scheme or None if a proper factory is not found
+ :param scheme: the scheme. If None the default scheme is used
+ :type scheme: str or None
+ :return: the factory class object for the given scheme or None if a
+ proper factory is not found
+ :rtype: taurus.core.taurusfactory.TaurusFactory or None
"""
if scheme is None:
return self.getDefaultFactory()
@@ -241,9 +259,12 @@ class TaurusManager(Singleton, Logger):
def getObject(self, cls, name):
"""Gives the object for the given class with the given name
- :param cls: (taurus.core.taurusmodel.TaurusModel) object class
- :param name: (str) the object name
- :return: (taurus.core.taurusmodel.TaurusModel or None) a taurus model object
+ :param cls: object class
+ :type cls: taurus.core.taurusmodel.TaurusModel
+ :param name: the object name
+ :type name: str
+ :return: a taurus model object
+ :rtype: taurus.core.taurusmodel.TaurusModel or None
"""
factory = self._get_factory(name)
if factory is None:
@@ -253,9 +274,10 @@ class TaurusManager(Singleton, Logger):
def findObject(self, absolute_name):
"""Finds the object with the given name
- :param absolute_name: (str) the object name
- :return: (taurus.core.taurusmodel.TaurusModel or None) the taurus model object or None if
- no suitable name found
+ :param absolute_name: the object name
+ :type absolute_name: str
+ :return: the taurus model object or None if no suitable name found
+ :rtype: taurus.core.taurusmodel.TaurusModel or None
"""
factory = self._get_factory(absolute_name)
if factory is None:
@@ -265,9 +287,11 @@ class TaurusManager(Singleton, Logger):
def findObjectClass(self, absolute_name):
"""Finds the object class for the given object name
- :param absolute_name: (str) the object name
- :return: (class taurus.core.taurusmodel.TaurusModel or None) the taurus model class object or
- None if no suitable name found
+ :param absolute_name: the object name
+ :type absolute_name: str
+ :return: the taurus model class object or None if no suitable name
+ found
+ :rtype: class taurus.core.taurusmodel.TaurusModel or None
"""
factory = self._get_factory(absolute_name)
if factory is None:
@@ -277,8 +301,10 @@ class TaurusManager(Singleton, Logger):
def getAuthority(self, name):
"""Returns a database object for the given name
- :param name: (str) database name
- :return: (taurus.core.taurusauthority.TaurusAuthority) the authority for the given name
+ :param name: database name
+ :type name: str
+ :return: the authority for the given name
+ :rtype: taurus.core.taurusauthority.TaurusAuthority
"""
return self.getObject(TaurusAuthority, name)
@@ -290,16 +316,20 @@ class TaurusManager(Singleton, Logger):
def getDevice(self, name):
"""Returns a device object for the given name
- :param name: (str) device name
- :return: (taurus.core.taurusdevice.TaurusDevice) the device for the given name
+ :param name: device name
+ :type name: str
+ :return: the device for the given name
+ :rtype: taurus.core.taurusdevice.TaurusDevice
"""
return self.getObject(TaurusDevice, name)
def getAttribute(self, name):
"""Returns a attribute object for the given name
- :param name: (str) attribute name
- :return: (taurus.core.taurusattribute.TaurusAttribute) the attribute for the given name
+ :param name: attribute name
+ :type name: str
+ :return: the attribute for the given name
+ :rtype: taurus.core.taurusattribute.TaurusAttribute
"""
return self.getObject(TaurusAttribute, name)
@@ -307,8 +337,10 @@ class TaurusManager(Singleton, Logger):
def getConfiguration(self, name):
"""Returns a configuration object for the given name
- :param name: (str) configuration name
- :return: (taurus.core.taurusconfiguration.TaurusConfiguration) the configuration for the given name
+ :param name: configuration name
+ :type name: str
+ :return: the configuration for the given name
+ :rtype: taurus.core.taurusconfiguration.TaurusConfiguration
"""
return self.getAttribute(name)
@@ -324,8 +356,10 @@ class TaurusManager(Singleton, Logger):
def getScheme(self, name):
"""Returns the scheme name for a given model name
- :param name: (str) model name
- :return: (str) scheme name
+ :param name: model name
+ :type name: str
+ :return: scheme name
+ :rtype: str
"""
return getSchemeFromName(name, implicit=True)
@@ -359,7 +393,8 @@ class TaurusManager(Singleton, Logger):
def buildPlugins(self):
"""Returns the current valid plugins
- :return: (dic) plugins
+ :return: plugins
+ :rtype: dic
"""
return self._build_plugins()
@@ -443,7 +478,8 @@ class TaurusManager(Singleton, Logger):
"""Executes the given operations
:param ops: the sequence of operations
- :type ops: sequence<taurus.core.taurusoperation.TaurusOperation>"""
+ :type ops: sequence<taurus.core.taurusoperation.TaurusOperation>
+ """
for o in ops:
o.execute()
diff --git a/lib/taurus/core/taurusmodel.py b/lib/taurus/core/taurusmodel.py
index f6a3609d..4d5e71f7 100644
--- a/lib/taurus/core/taurusmodel.py
+++ b/lib/taurus/core/taurusmodel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the base TaurusModel class"""
+"""This module contains the base TaurusModel class
+"""
import weakref
from collections.abc import Sequence
@@ -159,13 +160,17 @@ class TaurusModel(Logger):
def setSerializationMode(self, mode):
"""Sets the serialization mode for the system.
- :param mode: (TaurusSerializationMode) the new serialization mode"""
+ :param mode: the new serialization mode
+ :type mode: TaurusSerializationMode
+ """
self._serialization_mode = mode
def getSerializationMode(self):
"""Gives the serialization operation mode.
- :return: (TaurusSerializationMode) the current serialization mode"""
+ :return: the current serialization mode
+ :rtype: TaurusSerializationMode
+ """
return self._serialization_mode
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
@@ -201,11 +206,14 @@ class TaurusModel(Logger):
If the fragment cannot be computed, :class:`AttributeError` is raised
- :param fragmentName: (str or None) the returned value will correspond to
- the given fragmentName. If None is passed the
- defaultFragmentName will be used instead.
+ :param fragmentName: the returned value will correspond to the given
+ fragmentName. If None is passed the defaultFragmentName will be
+ used instead.
+ :type fragmentName: str or None
+
- :return: (obj) the computed fragment of the modelObj.
+ :return: the computed fragment of the modelObj.
+ :rtype: obj
"""
if fragmentName is None:
fragmentName = self.defaultFragmentName
diff --git a/lib/taurus/core/taurusoperation.py b/lib/taurus/core/taurusoperation.py
index c528f06d..b983f5f9 100644
--- a/lib/taurus/core/taurusoperation.py
+++ b/lib/taurus/core/taurusoperation.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the base taurus operation classes"""
+"""This module contains the base taurus operation classes
+"""
__all__ = ["TaurusOperation", "WriteAttrOperation"]
diff --git a/lib/taurus/core/tauruspollingtimer.py b/lib/taurus/core/tauruspollingtimer.py
index 5490bf04..0dfcc655 100644
--- a/lib/taurus/core/tauruspollingtimer.py
+++ b/lib/taurus/core/tauruspollingtimer.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the polling class"""
+"""This module contains the polling class
+"""
import weakref
import threading
@@ -40,13 +41,16 @@ __docformat__ = "restructuredtext"
class TaurusPollingTimer(Logger):
"""Polling timer manages a list of attributes that have to be polled in
- the same period"""
+ the same period
+ """
def __init__(self, period, parent=None):
"""Constructor
- :param period: (int) polling period (miliseconds)
- :param parent: (Logger) parent object (default is None)
+ :param period: polling period (miliseconds)
+ :type period: int
+ :param parent: parent object (default is None)
+ :type parent: Logger
"""
name = "TaurusPollingTimer[%d]" % period
super(TaurusPollingTimer, self).__init__(name=name, parent=parent)
@@ -92,10 +96,13 @@ class TaurusPollingTimer(Logger):
def containsAttribute(self, attribute):
"""Determines if the polling timer already contains this attribute
- :param attribute: (taurus.core.taurusattribute.TaurusAttribute) the attribute
+ :param attribute: the attribute
+ :type attribute: taurus.core.taurusattribute.TaurusAttribute
- :return: (bool) True if the attribute is registered for polling or
- False otherwise
+
+ :return: True if the attribute is registered for polling or False
+ otherwise
+ :rtype: bool
"""
dev, attr_name = attribute.getParentObj(), attribute.getSimpleName()
with self.lock:
@@ -105,17 +112,20 @@ class TaurusPollingTimer(Logger):
def getAttributeCount(self):
"""Returns the number of attributes registered for polling
- :return: (int) the number of attributes registered for polling
+ :return: the number of attributes registered for polling
+ :rtype: int
"""
return self.attr_nb
def addAttribute(self, attribute, auto_start=None):
"""Registers the attribute in this polling.
- :param attribute: (taurus.core.taurusattribute.TaurusAttribute) the attribute to be added
- :param auto_start: (bool) if True (default) it tells the polling timer
- that it should startup as soon as there is at least
- one attribute registered.
+ :param attribute: the attribute to be added
+ :type attribute: taurus.core.taurusattribute.TaurusAttribute
+ :param auto_start: if True (default) it tells the polling timer that it
+ should startup as soon as there is at least one attribute
+ registered.
+ :type auto_start: bool
"""
if auto_start == False:
self.deprecated(
@@ -145,7 +155,8 @@ class TaurusPollingTimer(Logger):
attributes decreses to 0 the polling is stopped automatically in order
to save resources.
- :param attribute: (taurus.core.taurusattribute.TaurusAttribute) the attribute to be added
+ :param attribute: the attribute to be added
+ :type attribute: taurus.core.taurusattribute.TaurusAttribute
"""
with self.lock:
dev, attr_name = (
diff --git a/lib/taurus/core/taurusvalidator.py b/lib/taurus/core/taurusvalidator.py
index 0191c42b..e7347138 100644
--- a/lib/taurus/core/taurusvalidator.py
+++ b/lib/taurus/core/taurusvalidator.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the base taurus name validator classes"""
+"""This module contains the base taurus name validator classes
+"""
import re
from taurus import tauruscustomsettings
@@ -71,7 +72,8 @@ class _TaurusBaseValidator(Singleton):
@property
def namePattern(self):
"""Provides a name pattern by composing the pattern strings for the
- URI segments"""
+ URI segments
+ """
return self.pattern % dict(
scheme=self.scheme,
authority=self.authority,
@@ -253,7 +255,8 @@ class TaurusAuthorityNameValidator(_TaurusBaseValidator):
def getNames(self, name, factory=None):
"""basic implementation for getNames for authorities. You may
- reimplement it in your scheme if required"""
+ reimplement it in your scheme if required
+ """
groups = self.getUriGroups(name)
if groups is None:
return None
diff --git a/lib/taurus/core/test/basevalidator.py b/lib/taurus/core/test/basevalidator.py
index 66281323..7b17639a 100644
--- a/lib/taurus/core/test/basevalidator.py
+++ b/lib/taurus/core/test/basevalidator.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test util module for creating test cases for name validators"""
+"""Test util module for creating test cases for name validators
+"""
# __all__ = []
diff --git a/lib/taurus/core/test/modelequality.py b/lib/taurus/core/test/modelequality.py
index 921ee4f2..2addf299 100644
--- a/lib/taurus/core/test/modelequality.py
+++ b/lib/taurus/core/test/modelequality.py
@@ -36,9 +36,12 @@ class TaurusModelEqualityTestCase(object):
"""A helper method to create tests that checks equality (or inequality)
of taurus objects e.g. TaurusAttribute.
- :param models: (seq<str>): a sequence of two taurus models
- :param class_: (function) model factory function
- :param equal: (bool) If True, check equality. Else check inequality
+ :param models: : a sequence of two taurus models
+ :type models: seq<str>
+ :param class_: model factory function
+ :type class_: function
+ :param equal: If True, check equality. Else check inequality
+ :type equal: bool
"""
deprecated(
dep="TaurusModelEqualityTestCase", alt="pytest", rel="4.7.1"
diff --git a/lib/taurus/core/test/test_taurushelper.py b/lib/taurus/core/test/test_taurushelper.py
index 8066a0f4..641c8e9a 100644
--- a/lib/taurus/core/test/test_taurushelper.py
+++ b/lib/taurus/core/test/test_taurushelper.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.taurushelper"""
+"""Test for taurus.core.taurushelper
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/core/util/argparse/taurusargparse.py b/lib/taurus/core/util/argparse/taurusargparse.py
index eed9daa8..990c0fbc 100644
--- a/lib/taurus/core/util/argparse/taurusargparse.py
+++ b/lib/taurus/core/util/argparse/taurusargparse.py
@@ -106,7 +106,8 @@ def get_taurus_parser(parser=None):
:param parser: an option parser or None (default) to create a new parser
:type parser: :class:`optparse.OptionParser`
:return: an option parser or the given parser if it is not None
- :rtype: :class:`optparse.OptionParser`"""
+ :rtype: :class:`optparse.OptionParser`
+ """
import optparse
if parser is None:
@@ -196,13 +197,15 @@ def parse_taurus_args(parser=None, args=None, values=None):
:param parser: an option parser or None (default) to create a new parser
:type parser: :class:`optparse.OptionParser`
- :param args: the list of arguments to process (default is None meaning: sys.argv[1:])
+ :param args: the list of arguments to process (default is None meaning:
+ sys.argv[1:])
:type args: seq<str>
- :param values: a :class:`optparse.Values` object to store option arguments in
- (default is None meaning: a new instance of Values) - if you give an
- existing object, the option defaults will not be initialized on it
+ :param values: a :class:`optparse.Values` object to store option arguments
+ in (default is None meaning: a new instance of Values) - if you give an
+ existing object, the option defaults will not be initialized on it
:return: a tuple of three elements: parser, options, args
- :rtype: :class:`optparse.OptionParser`, :class:`optparse.Values`, seq<str>"""
+ :rtype: :class:`optparse.OptionParser`, :class:`optparse.Values`, seq<str>
+ """
parser = get_taurus_parser(parser=parser)
options, args = parser.parse_args(args=args, values=values)
return parser, options, args
@@ -216,13 +219,15 @@ def init_taurus_args(parser=None, args=None, values=None):
:param parser: an option parser or None (default) to create a new parser
:type parser: :class:`optparse.OptionParser`
- :param args: the list of arguments to process (default is None meaning: sys.argv[1:])
+ :param args: the list of arguments to process (default is None meaning:
+ sys.argv[1:])
:type args: seq<str>
- :param values: a :class:`optparse.Values` object to store option arguments in
- (default is None meaning: a new instance of Values) - if you give an
- existing object, the option defaults will not be initialized on it
+ :param values: a :class:`optparse.Values` object to store option arguments
+ in (default is None meaning: a new instance of Values) - if you give an
+ existing object, the option defaults will not be initialized on it
:return: a tuple of three elements: parser, options, args
- :rtype: :class:`optparse.OptionParser`, :class:`optparse.Values`, seq<str>"""
+ :rtype: :class:`optparse.OptionParser`, :class:`optparse.Values`, seq<str>
+ """
import taurus
parser, options, args = parse_taurus_args(
@@ -290,11 +295,12 @@ def split_taurus_args(parser, args=None):
:param parser: an option parser
:type parser: :class:`optparse.OptionParser`
- :param args: the list of arguments to process
- (default is None meaning: sys.argv)
+ :param args: the list of arguments to process (default is None meaning:
+ sys.argv)
:type args: seq<str>
:return: a tuple of two elements: parser args, non parser args
- :rtype: seq<seq<str>, seq<str>>"""
+ :rtype: seq<seq<str>, seq<str>>
+ """
if args is None:
import sys
diff --git a/lib/taurus/core/util/codecs.py b/lib/taurus/core/util/codecs.py
index 8fa703f6..9c363574 100644
--- a/lib/taurus/core/util/codecs.py
+++ b/lib/taurus/core/util/codecs.py
@@ -103,22 +103,36 @@ class Codec(Logger):
"""encodes the given data. This method is abstract an therefore must
be implemented in the subclass.
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
- :raises: NotImplementedError"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+
+
+ :raises: NotImplementedError
+ """
raise NotImplementedError("encode cannot be called on abstract Codec")
def decode(self, data, *args, **kwargs):
"""decodes the given data. This method is abstract an therefore must
be implemented in the subclass.
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
- :raises: NotImplementedError"""
+
+ :raises: NotImplementedError
+ """
raise NotImplementedError("decode cannot be called on abstract Codec")
def __str__(self):
@@ -132,9 +146,15 @@ class NullCodec(Codec):
def encode(self, data, *args, **kwargs):
"""encodes with Null encoder. Just returns the given data
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
format = "null"
if len(data[0]):
format += "_%s" % data[0]
@@ -143,9 +163,15 @@ class NullCodec(Codec):
def decode(self, data, *args, **kwargs):
"""decodes with Null encoder. Just returns the given data
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
if not data[0].startswith("null"):
return data
format = data[0].partition("_")[2]
@@ -168,14 +194,21 @@ class ZIPCodec(Codec):
1200, 31
>>> format, decoded_data = codec.decode((format, encoded_data))
>>> print(decoded_data[20])
- 'Hello world\\nHello wo'"""
+ 'Hello world\\nHello wo'
+ """
def encode(self, data, *args, **kwargs):
"""encodes the given data to gzip bytes. The given data **must** be bytes
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import zlib
format = "zip"
@@ -186,9 +219,15 @@ class ZIPCodec(Codec):
def decode(self, data, *args, **kwargs):
"""decodes the given data from a gzip bytes.
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import zlib
if not data[0].startswith("zip"):
@@ -213,14 +252,21 @@ class BZ2Codec(Codec):
1200, 68
>>> format, decoded_data = codec.decode((format, encoded_data))
>>> print(decoded_data[20])
- 'Hello world\\nHello wo'"""
+ 'Hello world\\nHello wo'
+ """
def encode(self, data, *args, **kwargs):
"""encodes the given data to bz2 bytes. The given data **must** be bytes
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import bz2
format = "bz2"
@@ -231,9 +277,15 @@ class BZ2Codec(Codec):
def decode(self, data, *args, **kwargs):
"""decodes the given data from bz2 bytes.
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import bz2
if not data[0].startswith("bz2"):
@@ -260,17 +312,22 @@ class PickleCodec(Codec):
>>> # now decode it
>>> format, decoded_data = codec.decode((format, encoded_data))
>>> print(decoded_data)
- {'hello': 'world', 'goodbye': 1000}"""
+ {'hello': 'world', 'goodbye': 1000}
+ """
def encode(self, data, *args, **kwargs):
"""encodes the given data to pickle bytes. The given data **must** be
a python object that :mod:`pickle` is able to convert.
- :param data: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import pickle
format = "pickle"
@@ -283,11 +340,15 @@ class PickleCodec(Codec):
def decode(self, data, *args, **kwargs):
"""decodes the given data from a pickle string.
- :param data: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object"""
+
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import pickle
if not data[0].startswith("pickle"):
@@ -320,17 +381,22 @@ class JSONCodec(Codec):
>>> # now decode it
>>> format, decoded_data = codec.decode((format, encoded_data))
>>> print(decoded_data)
- {'hello': 'world', 'goodbye': 1000}"""
+ {'hello': 'world', 'goodbye': 1000}
+ """
def encode(self, data, *args, **kwargs):
"""encodes the given data to a json string. The given data **must** be
a python object that json is able to convert.
- :param data: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object"""
+
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import json
format = "json"
@@ -343,11 +409,15 @@ class JSONCodec(Codec):
def decode(self, data, *args, **kwargs):
"""decodes the given data from a json string.
- :param data: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object"""
+
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import json
if not data[0].startswith("json"):
@@ -410,11 +480,14 @@ class Utf8Codec(Codec):
"""
Encodes the given utf8 string to bytes.
- :param data: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
"""
format = "utf8"
fmt, data = data
@@ -425,11 +498,14 @@ class Utf8Codec(Codec):
def decode(self, data, *args, **kwargs):
"""decodes the given data from a bytes.
- :param data: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
"""
fmt, data = data
fmt = fmt.partition("_")[2]
@@ -454,17 +530,22 @@ class BSONCodec(Codec):
>>> # now decode it
>>> _, decoded_data = codec.decode((format, encoded_data))
>>> print(decoded_data)
- {'hello': 'world', 'goodbye': 1000}"""
+ {'hello': 'world', 'goodbye': 1000}
+ """
def encode(self, data, *args, **kwargs):
"""encodes the given data to a bson string. The given data **must** be
a python object that bson is able to convert.
- :param data: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object"""
+
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import bson
format = "bson"
@@ -475,11 +556,15 @@ class BSONCodec(Codec):
def decode(self, data, *args, **kwargs):
"""decodes the given data from a bson string.
- :param data: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the
- first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
import bson
if not data[0].startswith("bson"):
@@ -572,9 +657,15 @@ class VideoImageCodec(Codec):
def encode(self, data, *args, **kwargs):
"""encodes the given data to a LImA's video_image. The given data **must** be an numpy.array
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
# TODO: support encoding for colour imgage modes
@@ -592,9 +683,15 @@ class VideoImageCodec(Codec):
def decode(self, data, *args, **kwargs):
"""decodes the given data from a LImA's video_image.
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
if data[0].startswith("VIDEO_IMAGE"):
fixedformat = data[0].replace("VIDEO_IMAGE", "videoimage")
@@ -862,7 +959,9 @@ class CodecPipeline(Codec, list):
the :class:`CodecFactory` to search for format(s) given in the format
parameter.
- :param format: (str) a string representing the format."""
+ :param format: a string representing the format.
+ :type format: str
+ """
Codec.__init__(self)
list.__init__(self)
@@ -881,9 +980,15 @@ class CodecPipeline(Codec, list):
def encode(self, data, *args, **kwargs):
"""encodes the given data.
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
for codec in reversed(self):
data = codec.encode(data, *args, **kwargs)
return data
@@ -891,9 +996,15 @@ class CodecPipeline(Codec, list):
def decode(self, data, *args, **kwargs):
"""decodes the given data.
- :param data: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object
+ :param data: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :type data: sequence[str, obj]
+
- :return: (sequence[str, obj]) a sequence of two elements where the first item is the encoding format of the second item object"""
+ :return: a sequence of two elements where the first item is the
+ encoding format of the second item object
+ :rtype: sequence[str, obj]
+ """
for codec in self:
data = codec.decode(data, *args, **kwargs)
return data
@@ -978,8 +1089,11 @@ class CodecFactory(Singleton, Logger):
"""Registers a new codec. If a codec already exists for the given format
it is removed.
- :param format: (str) the codec id
- :param klass: (Codec class) the class that handles the format"""
+ :param format: the codec id
+ :type format: str
+ :param klass: the class that handles the format
+ :type klass: Codec class
+ """
self._codec_klasses[format] = klass
# del old codec if exists
@@ -990,9 +1104,12 @@ class CodecFactory(Singleton, Logger):
"""Unregisters the given format. If the format does not exist an exception
is thrown.
- :param format: (str) the codec id
+ :param format: the codec id
+ :type format: str
+
- :raises: KeyError"""
+ :raises: KeyError
+ """
if format in self._codec_klasses:
del self._codec_klasses[format]
@@ -1003,9 +1120,13 @@ class CodecFactory(Singleton, Logger):
"""Returns the codec object for the given format or None if no suitable
codec is found
- :param format: (str) the codec id
+ :param format: the codec id
+ :type format: str
+
- :return: (Codec or None) the codec object for the given format"""
+ :return: the codec object for the given format
+ :rtype: Codec or None
+ """
codec = self._codecs.get(format)
if codec is None:
codec = self._getNewCodec(format)
diff --git a/lib/taurus/core/util/colors.py b/lib/taurus/core/util/colors.py
index 25783bc9..8a432044 100644
--- a/lib/taurus/core/util/colors.py
+++ b/lib/taurus/core/util/colors.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains color codes for state and quality"""
+"""This module contains color codes for state and quality
+"""
__all__ = [
"DEVICE_STATE_DATA",
@@ -124,7 +125,8 @@ class ColorPalette(object):
def number(self, stoq, fg=False):
"""Returns the colors as a number,
- suitable for conversion to hexadecimal as argument to QtGui.QColor."""
+ suitable for conversion to hexadecimal as argument to QtGui.QColor.
+ """
r = self.rgb(stoq, fg)
return r[0] * 256 * 256 + r[1] * 256 + r[2]
diff --git a/lib/taurus/core/util/console.py b/lib/taurus/core/util/console.py
index 8792dcb7..c472a807 100644
--- a/lib/taurus/core/util/console.py
+++ b/lib/taurus/core/util/console.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains ANSI color codes"""
+"""This module contains ANSI color codes
+"""
__all__ = ["make_color_table", "NoColors", "TermColors", "HTMLColors"]
@@ -32,7 +33,8 @@ __docformat__ = "restructuredtext"
def make_color_table(in_class, use_name=False, fake=False):
"""Build a set of color attributes in a class.
- Helper function for building the TermColors classes."""
+ Helper function for building the TermColors classes.
+ """
color_templates = (
("Black", "0;30"),
("Red", "0;31"),
@@ -79,7 +81,8 @@ class TermColors(object):
This class should be used as a mixin for building color schemes.
- Basicaly this class is just a copy of IPython.ColorANSI.TermColors class"""
+ Basicaly this class is just a copy of IPython.ColorANSI.TermColors class
+ """
NoColor = "" # for color schemes in color-less terminals.
Normal = "\033[0m" # Reset normal coloring
diff --git a/lib/taurus/core/util/containers.py b/lib/taurus/core/util/containers.py
index 94d03a12..9695b4f3 100644
--- a/lib/taurus/core/util/containers.py
+++ b/lib/taurus/core/util/containers.py
@@ -85,7 +85,8 @@ class CaselessList(list):
def findentry(self, item):
"""A caseless way of checking if an item is in the list or not.
- It returns None or the entry."""
+ It returns None or the entry.
+ """
if not isinstance(item, str):
raise TypeError(
"Members of this object must be strings. "
@@ -134,7 +135,8 @@ class CaselessList(list):
def extend(self, item):
"""Extend the list with another list. Each member of the list must be
- a string."""
+ a string.
+ """
if not isinstance(item, list):
raise TypeError(
"You can only extend lists with lists. "
@@ -150,7 +152,8 @@ class CaselessList(list):
def count(self, item):
"""Counts references to 'item' in a caseless manner.
- If item is not a string it will always return 0."""
+ If item is not a string it will always return 0.
+ """
if not isinstance(item, str):
return 0
count = 0
@@ -184,7 +187,8 @@ class CaselessList(list):
def insert(self, i, x):
"""s.insert(i, x) same as s[i:i] = [x]
- Raises TypeError if x isn't a string."""
+ Raises TypeError if x isn't a string.
+ """
if not isinstance(x, str):
raise TypeError(
"Members of this object must be strings. "
@@ -236,12 +240,14 @@ class CaselessList(list):
"""Called to implement evaluation of self[i:j].
Although the manual says this method is deprecated - if I don't define
it the list one is called.
- (Which returns a list - this returns a CaselessList)"""
+ (Which returns a list - this returns a CaselessList)
+ """
return CaselessList(list.__getslice__(self, i, j))
def __getitem__(self, index):
"""For fetching indexes.
- If a slice is fetched then the list returned is a CaselessList."""
+ If a slice is fetched then the list returned is a CaselessList.
+ """
if not isinstance(index, slice):
return list.__getitem__(self, index)
else:
@@ -249,12 +255,14 @@ class CaselessList(list):
def __add__(self, item):
"""To add a list, and return a CaselessList.
- Every element of item must be a string."""
+ Every element of item must be a string.
+ """
return CaselessList(list.__add__(self, item))
def __radd__(self, item):
"""To add a list, and return a CaselessList.
- Every element of item must be a string."""
+ Every element of item must be a string.
+ """
return CaselessList(list.__add__(self, item))
def __iadd__(self, item):
@@ -264,18 +272,21 @@ class CaselessList(list):
def __mul__(self, item):
"""To multiply itself, and return a CaselessList.
- Every element of item must be a string."""
+ Every element of item must be a string.
+ """
return CaselessList(list.__mul__(self, item))
def __rmul__(self, item):
"""To multiply itself, and return a CaselessList.
- Every element of item must be a string."""
+ Every element of item must be a string.
+ """
return CaselessList(list.__rmul__(self, item))
class CaselessDict(dict):
"""A case insensitive dictionary. Use this class as a normal dictionary.
- The keys must be strings"""
+ The keys must be strings
+ """
def __init__(self, other=None):
if other:
@@ -404,7 +415,6 @@ class PersistentDict(dict):
Input file format is automatically discovered.
Output file format is selectable between pickle, json, and csv.
All three serialization formats are backed by fast C implementations.
-
"""
def __init__(
@@ -495,7 +505,8 @@ class LoopList(object):
- for item in llist: print(item) # This is a infinite loop!!
- for i in range(len(llist)):print(llist[i]) #This is not infinite
- since len(llist) returns the period of the list"""
+ since len(llist) returns the period of the list
+ """
def __init__(self, itemlist=[]):
self.setItemList(itemlist)
@@ -575,7 +586,8 @@ class CircBuf(object):
>>> cb.get()
'fourth'
>>> cb.is_empty()
- 1"""
+ 1
+ """
def __init__(self, leng):
"""Construct an empty circular buffer."""
@@ -710,7 +722,8 @@ def self_locked(func, reentrant=True):
- With Lock() this decorator should not be used to decorate
nested functions; it will cause Deadlock!
- With RLock this problem is avoided ... but you should rely more
- on python threading"""
+ on python threading
+ """
import threading
def lock_fun(self, *args, **kwargs):
@@ -749,7 +762,8 @@ class ThreadDict(dict):
Briefing::
a[2] equals to a[2]=read_method(2)
- a[2]=1 equals to a[2]=write_method(2,1)"""
+ a[2]=1 equals to a[2]=write_method(2,1)
+ """
def __init__(
self,
@@ -966,8 +980,9 @@ class SortedDict(dict):
def sort(self, key):
"""
This method modifies the sorting of the dictionary overriding the existing sort key.
- :param key: it can be a sequence containing all the keys already existing in the dictionary
- or a callable providing a sorting key algorithm.
+ :param key: it can be a sequence containing all the keys already
+ existing in the dictionary or a callable providing a sorting key
+ algorithm.
"""
import operator
@@ -1142,7 +1157,8 @@ def getDictAsTree(dct):
"""This method will print a recursive dict in a tree-like
shape::
- >>> print(getDictAsTree({'A':{'B':[1,2],'C':[3]}}))"""
+ >>> print(getDictAsTree({'A':{'B':[1,2],'C':[3]}}))
+ """
def add_to_level(l, d):
lines = []
@@ -1187,18 +1203,22 @@ class ArrayBuffer(object):
The :meth:`append` and meth:`extend` methods are designed to be cheap
(especially if the internal buffer size is already at the maximum size), at
- the expense of memory usage"""
+ the expense of memory usage
+ """
def __init__(self, buffer, maxSize=0):
"""Creator.
- :param buffer: (numpy.array) a numpy.array suitable to be used as the
- internal buffer.
+ :param buffer: a numpy.array suitable to be used as the internal
+ buffer.
+ :type buffer: numpy.array
+
- :param maxSize: (int) Maximum size of the internal buffer. The internal
- buffer length will be allowed to grow up to this value.
- If maxSize=0 (default), the maximum size will be that of
- the given buffer
+ :param maxSize: Maximum size of the internal buffer. The internal
+ buffer length will be allowed to grow up to this value. If
+ maxSize=0 (default), the maximum size will be that of the given
+ buffer
+ :type maxSize: int
"""
self.__buffer = buffer
@@ -1255,7 +1275,9 @@ class ArrayBuffer(object):
buffer size is reached, elements get discarded on the begginning to keep
the size within the limit
- :param x: (scalar) element to be appended
+ :param x: element to be appended
+ :type x: scalar
+
.. seealso:: :meth:`extend`
"""
@@ -1275,7 +1297,9 @@ class ArrayBuffer(object):
buffer size is reached, elements get discarded on the begginning to keep
the size within the limit
- :param a: (numpy.array) array of elements to append
+ :param a: array of elements to append
+ :type a: numpy.array
+
.. seealso:: :meth:`append`, :meth:`extendLeft`
"""
@@ -1297,9 +1321,12 @@ class ArrayBuffer(object):
extent method, no data will be discarded if the maximum size limit is
reached. Instead, an exception will be raised.
- :param a: (numpy.array) array of elements to append
+ :param a: array of elements to append
+ :type a: numpy.array
- .. seealso:: :meth:`extend`"""
+
+ .. seealso:: :meth:`extend`
+ """
len_a = a.shape[0]
newend = self.__end + len_a
if newend < self.__bsize:
@@ -1326,7 +1353,9 @@ class ArrayBuffer(object):
**Note:** if n is larger or equal than the maximum buffer size, the
whole buffer is wiped
- :param n: (int)"""
+ :param n:
+ :type n: int
+ """
newend = max(0, self.__end - n)
self.__buffer[0:newend] = self.__buffer[n : self.__end]
self.__end = newend
@@ -1338,7 +1367,9 @@ class ArrayBuffer(object):
It is equivalent to b[:]
- :return: (numpy.array) array of contents
+ :return: array of contents
+ :rtype: numpy.array
+
.. seealso:: :meth:`toArray`
"""
@@ -1348,7 +1379,9 @@ class ArrayBuffer(object):
"""returns a copy of the array of the contents. It is equivalent to
``b.contents.copy()``
- :return: (numpy.array) copy of array of contents
+ :return: copy of array of contents
+ :rtype: numpy.array
+
.. seealso:: :meth:`contents`
"""
@@ -1357,8 +1390,10 @@ class ArrayBuffer(object):
def contentsSize(self):
"""Equivalent to len(b)
- :return: (int) length of the current contents of the ArrayBuffer (not
- the maximum size of the buffer)
+ :return: length of the current contents of the ArrayBuffer (not the
+ maximum size of the buffer)
+ :rtype: int
+
.. seealso:: :meth:`maxSize`
"""
@@ -1367,7 +1402,9 @@ class ArrayBuffer(object):
def bufferSize(self):
"""Returns the current size of the internal buffer
- :return: (int) lcurrent length of the internal buffer
+ :return: lcurrent length of the internal buffer
+ :rtype: int
+
.. seealso:: :meth:`contentsSize`, :meth:`maxSize`
"""
@@ -1377,7 +1414,9 @@ class ArrayBuffer(object):
"""Returns the maximum size of the internal buffer, beyond which the
ArrayBuffer starts discarding elements when appending
- :return: (int) maximum length of the internal buffer
+ :return: maximum length of the internal buffer
+ :rtype: int
+
.. seealso:: :meth:`contentsSize`, :meth:`append`, :meth:`extend`, :meth:`isFull`
"""
@@ -1387,7 +1426,9 @@ class ArrayBuffer(object):
"""Sets the maximum size of the internal buffer, beyond which the
ArrayBuffer starts discarding elements when appending
- :param maxSize: (int) maximum length of the internal buffer
+ :param maxSize: maximum length of the internal buffer
+ :type maxSize: int
+
.. seealso:: :meth:`contentsSize`, :meth:`append`, :meth:`extend`, :meth:`isFull`
"""
@@ -1401,7 +1442,9 @@ class ArrayBuffer(object):
def isFull(self):
"""Whether the contents fill the whole of the internal buffer
- :return: (bool) True if the contents fill the maximum size. False otherwise.
+ :return: True if the contents fill the maximum size. False otherwise.
+ :rtype: bool
+
.. seealso:: :meth:`maxSize`
"""
@@ -1410,7 +1453,9 @@ class ArrayBuffer(object):
def remainingSize(self):
"""returns the remaining free space in the internal buffer (e.g., 0 if it is full)
- :return: (int) length of the unused space in the internal buffer
+ :return: length of the unused space in the internal buffer
+ :rtype: int
+
.. seealso:: :meth:`contentsSize`, :meth:`maxSize`,
"""
diff --git a/lib/taurus/core/util/decorator/decorator.py b/lib/taurus/core/util/decorator/decorator.py
index 2cce1aad..be86fdb9 100644
--- a/lib/taurus/core/util/decorator/decorator.py
+++ b/lib/taurus/core/util/decorator/decorator.py
@@ -67,7 +67,6 @@ def decorator(func):
return a + b
assert test == 5
-
"""
def isFuncArg(*args, **kw):
diff --git a/lib/taurus/core/util/decorator/typecheck.py b/lib/taurus/core/util/decorator/typecheck.py
index cf9603d7..175c7a61 100644
--- a/lib/taurus/core/util/decorator/typecheck.py
+++ b/lib/taurus/core/util/decorator/typecheck.py
@@ -63,7 +63,6 @@ Needed to cast params as floats in function def (or simply divide by 2.0)::
Traceback (most recent call last):
...
TypeError: 'fib' method accepts (int), but was given (float)
-
"""
import sys
@@ -80,7 +79,6 @@ def accepts(*types, **kw):
:param types: The expected type of the decorated function's return value
:param debug: Optional specification of 'debug' level (0 | 1 | 2)
-
"""
if not kw:
# default level: MEDIUM
@@ -118,9 +116,9 @@ def returns(ret_type, **kw):
Function decorator. Checks that return value of decorated function
is of the expected type.
- :param ret_type: The expected type of the decorated function's return value.
+ :param ret_type: The expected type of the decorated function's return
+ value.
:param debug: Optional specification of 'debug' level (0 | 1 | 2)
-
"""
try:
if not kw:
diff --git a/lib/taurus/core/util/enumeration.py b/lib/taurus/core/util/enumeration.py
index eaf3c502..6baf5d24 100644
--- a/lib/taurus/core/util/enumeration.py
+++ b/lib/taurus/core/util/enumeration.py
@@ -31,7 +31,8 @@ constants (A, B, C, D = range(4)) but it doesn't scale well to large numbers,
and it doesn't allow you to specify values for some constants while leaving
others unspecified. This approach does those things, while verifying that all
values (specified and unspecified) are unique. Enum values then are attributes
-of an Enumeration class (Volkswagen.BEETLE, Volkswagen.PASSAT, etc.)."""
+of an Enumeration class (Volkswagen.BEETLE, Volkswagen.PASSAT, etc.).
+"""
__all__ = ["EnumException", "Enumeration"]
@@ -40,7 +41,8 @@ __docformat__ = "restructuredtext"
class EnumException(Exception):
"""Exception thrown by :class:`Enumeration` when trying to declare an
- invalid enumeration."""
+ invalid enumeration.
+ """
pass
@@ -194,20 +196,23 @@ class Enumeration(object):
:param key: the key
:type key: str
:return: True if the key is in the enumeration or False otherswise
- :rtype: bool"""
+ :rtype: bool
+ """
return key in self.lookup
def keys(self):
"""Returns an iterable containning the valid enumeration keys
:return: an interable containning the valid enumeration keys
- :rtype: iter<str>"""
+ :rtype: iter<str>
+ """
return list(self.lookup.keys())
def whatis(self, value):
"""Returns a string representation of the value in the enumeration.
:param value: a valid enumeration element
:return: a string representation of the given enumeration element
- :rtype: str"""
+ :rtype: str
+ """
return self.reverseLookup[value]
def get(self, i):
diff --git a/lib/taurus/core/util/event.py b/lib/taurus/core/util/event.py
index 07d7dee3..56b3864f 100644
--- a/lib/taurus/core/util/event.py
+++ b/lib/taurus/core/util/event.py
@@ -51,7 +51,8 @@ __docformat__ = "restructuredtext"
class BoundMethodWeakref(object):
"""This class represents a weak reference to a method of an object since
- weak references to methods don't work by themselves"""
+ weak references to methods don't work by themselves
+ """
def __init__(self, bound_method, del_cb=None):
cb = del_cb and self._deleted
@@ -189,7 +190,8 @@ class EventGenerator(Object):
:param events_active: generate events (default is True)
:type events_active: bool
:return: a new EventGenerator
- :rtype: EventGenerator"""
+ :rtype: EventGenerator
+ """
self.call__init__(Object)
self.event_name = name
self.cb_list = []
@@ -262,8 +264,9 @@ class EventGenerator(Object):
:param cb: a callable object
:type cb: callable
:param data: extra data to send each time an event is triggered on the
- given callback. Default is None
- :type data: object"""
+ given callback. Default is None
+ :type data: object
+ """
cb_ref = CallableRef(cb)
try:
self.lock()
@@ -283,10 +286,11 @@ class EventGenerator(Object):
:param cb: a callable object
:type cb: callable
:param data: extra data to send each time an event is triggered on the
- given callback. Default is None
+ given callback. Default is None
:type data: object
:return: True if callback is registered or False otherwise
- :rtype: bool"""
+ :rtype: bool
+ """
cb_ref = CallableRef(cb, self.unsubscribeDeletedEvent)
return (cb_ref, data) in self.cb_list
@@ -294,19 +298,22 @@ class EventGenerator(Object):
"""(De)activates events on this event generator.
:param events_active: activate/deactivate events
- :type events_active: bool"""
+ :type events_active: bool
+ """
self.events_active = events_active
def getEventsActive(self):
"""Determines is events are active
:return: True if events are active or False otherwise
- :rtype: bool"""
+ :rtype: bool
+ """
return self.events_active
def fireEvent(self, val, event_val=None):
"""Fires an event.
:param val: event value
- :type val: object"""
+ :type val: object
+ """
try:
self.lock()
self.last_val = val
@@ -333,14 +340,15 @@ class EventGenerator(Object):
:param equal: check for equality. Default is True
:type equal: bool
:param any: if True unblock after first event, not matter what value it
- has. Default is False.
+ has. Default is False.
:type any: bool
:param timeout: maximum time to wait (seconds). Default is None meaning
- wait forever.
+ wait forever.
:type timeout: float
:param stack: For internal usage only.
:return: the value of the event that unblocked the wait
- :rtype: object"""
+ :rtype: object
+ """
if not self.events_active:
raise RuntimeError(
"%s does not have " "events/polling active" % self.event_name
@@ -378,7 +386,8 @@ class EventGenerator(Object):
"""Read the last event
:return: the last event value
- :rtype: object"""
+ :rtype: object
+ """
return self.last_val
@@ -387,7 +396,8 @@ class EventListener(object):
Note: Since this class stores for each event value the last timestamp when
it occured, it should only be used for events for which the event value
- domain (possible values) is limited and well known (ex: an enum)"""
+ domain (possible values) is limited and well known (ex: an enum)
+ """
def __init__(self):
self.last_val = None
@@ -421,7 +431,8 @@ class EventListener(object):
this function when you have the lock acquired on this object.
:param v: event value
- :type v: object"""
+ :type v: object
+ """
try:
t = time.time()
self.lock()
@@ -454,10 +465,10 @@ class EventListener(object):
:param val: value to compare
:type val: object
:param after: timestamp. wait for events comming after the given time.
- default value is 0 meaning any event after Jan 1, 1970
+ default value is 0 meaning any event after Jan 1, 1970
:type after: float
:param equal: compare for equality. equal=True means an event with the
- given value, equal=False means any event which as a different value
+ given value, equal=False means any event which as a different value
:type equal: bool
"""
s = self.event_set
@@ -496,7 +507,8 @@ class ListEventGenerator(EventGenerator):
this function when you have the lock acquired on this object.
:param val: event value
- :type val: object"""
+ :type val: object
+ """
# if attribute is not alive and last time was also not alive then
# skip the event propagation
if val is None:
@@ -519,7 +531,8 @@ class ListEventGenerator(EventGenerator):
class AttributeEventWait(object):
"""Class designed to connect to a :class:`taurus.core.taurusattribute.TaurusAttribute` and
- fire events or wait for a certain event."""
+ fire events or wait for a certain event.
+ """
def __init__(self, attr=None):
self._last_val = None
@@ -532,7 +545,8 @@ class AttributeEventWait(object):
def connect(self, attr):
"""Connect to the given attribute
:param attr: the attribute to connect to
- :type attr: taurus.core.taurusattribute.TaurusAttribute"""
+ :type attr: taurus.core.taurusattribute.TaurusAttribute
+ """
needAdd = True
if self._attr is not None:
if attr == self._attr:
@@ -582,7 +596,8 @@ class AttributeEventWait(object):
def eventReceived(self, s, t, v):
"""Event listener method for the underlying attribute. Do not call this
method. It will be called internally when the attribute generates
- an event."""
+ an event.
+ """
if t == taurus.core.taurusbasetypes.TaurusEventType.Config:
return
elif t == taurus.core.taurusbasetypes.TaurusEventType.Error:
@@ -596,7 +611,8 @@ class AttributeEventWait(object):
this function when you have the lock acquired on this object.
:param v: event value
- :type v: object"""
+ :type v: object
+ """
t = time.time()
self.lock()
try:
@@ -611,7 +627,8 @@ class AttributeEventWait(object):
been received or the last event was an error event
:return: the last event value to be recorded
- :rtype: object"""
+ :rtype: object
+ """
return self._last_val
def getRecordedEvents(self):
@@ -619,7 +636,8 @@ class AttributeEventWait(object):
events. Modify the return dictionary at your own risk!
:return: reference to the internal event dictionary
- :rtype: dict"""
+ :rtype: dict
+ """
return self._event_set
def getRecordedEvent(self, v):
@@ -628,8 +646,10 @@ class AttributeEventWait(object):
:param v: event value
:type v: object
- :return: local timestamp for the event or None if no event has been recorded
- :rtype: float"""
+ :return: local timestamp for the event or None if no event has been
+ recorded
+ :rtype: float
+ """
return self._event_set.get(v)
def _isEventRecorded(self, values, after, equal, ignore_values):
@@ -660,19 +680,19 @@ class AttributeEventWait(object):
:param val: value to compare
:type val: object
:param after: timestamp. wait for events comming after the given time.
- default value is 0 meaning any event after Jan 1, 1970
+ default value is 0 meaning any event after Jan 1, 1970
:type after: float
:param equal: compare for equality. equal=True means an event with the
- given value, equal=False means any event which as a different value
+ given value, equal=False means any event which as a different value
:type equal: bool
:param timeout: maximum time to wait (seconds). Default is None meaning
- wait forever.
+ wait forever.
:type timeout: float
:param retries: number of maximum retries of max timeout to attempts.
- Default is -1 meaning infinite number of retries.
- 0 means no wait. Positive number is obvious.
+ Default is -1 meaning infinite number of retries. 0 means no wait.
+ Positive number is obvious.
:param any: if any is True ignore 'val' parameter and accept any event.
- If False (default),check with given 'val' parameter
+ If False (default),check with given 'val' parameter
:type any: bool
"""
from taurus.core.util.log import deprecated
@@ -735,24 +755,23 @@ class AttributeEventWait(object):
:param values: the event value should match one of this
:type values: seq<object>
:param after: timestamp. wait for events comming after the given time.
- default value is 0 meaning any event after Jan 1, 1970
+ default value is 0 meaning any event after Jan 1, 1970
:type after: float
:param equal: compare for equality. equal=True means an event with the
- given value, equal=False means any event which as
- a different value
+ given value, equal=False means any event which as a different value
:type equal: bool
:param timeout: maximum time to wait (seconds). Default is None meaning
- wait forever.
+ wait forever.
:type timeout: float
- :param reactivity: setting reactivity (seconds) waranties
- reactions to aborts comming from other threads
- in at most the reactivity time.
- Default is None meaning no reactivity within timeout.
- :param ignore_values: if any is True ignore 'values' parameter and accept any event.
- If False (default),check with given 'values' parameter
+ :param reactivity: setting reactivity (seconds) waranties reactions to
+ aborts comming from other threads in at most the reactivity time.
+ Default is None meaning no reactivity within timeout.
+ :param ignore_values: if any is True ignore 'values' parameter and
+ accept any event. If False (default),check with given 'values'
+ parameter
:type ignore_values: bool
- :return: The return value is `True` unless a given timeout expired,
- in which case it is `False`.
+ :return: The return value is `True` unless a given timeout expired, in
+ which case it is `False`.
:rtype: bool
"""
if timeout is not None and reactivity is not None:
diff --git a/lib/taurus/core/util/eventfilters.py b/lib/taurus/core/util/eventfilters.py
index 64851858..b4e13edd 100644
--- a/lib/taurus/core/util/eventfilters.py
+++ b/lib/taurus/core/util/eventfilters.py
@@ -24,7 +24,8 @@
#############################################################################
"""event filters library to be used with
-:meth:`taurus.qt.qtgui.base.TaurusBaseComponent.setFilters`"""
+:meth:`taurus.qt.qtgui.base.TaurusBaseComponent.setFilters`
+"""
def IGNORE_ALL(s, t, v):
@@ -162,7 +163,6 @@ class RepeatedEventFilter(object):
filters = [RepeatedEventFilter(), IGNORE_CONFIG]
filterEvent(s, t, v, filters)
-
"""
def __init__(self):
@@ -188,16 +188,20 @@ def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1, filters=()):
"""The event is processed by each and all filters in strict order
unless one of them returns None (in which case the event is discarded)
- :param evt_src: (object) object that triggered the event
- :param evt_type: (TaurusEventType) type of event
- :param evt_value: (object) event value
- :param filters: (sequence<callable>) a sequence of callables, each returning
- either None (to discard the event) or the tuple (with
- possibly transformed values) of
- (evt_src, evt_type, evt_value)
+ :param evt_src: object that triggered the event
+ :type evt_src: object
+ :param evt_type: type of event
+ :type evt_type: TaurusEventType
+ :param evt_value: event value
+ :type evt_value: object
+ :param filters: a sequence of callables, each returning either None (to
+ discard the event) or the tuple (with possibly transformed values) of
+ (evt_src, evt_type, evt_value)
+ :type filters: sequence<callable>
+
- :return: (None or tuple) The result of piping the event through the given
- filters.
+ :return: The result of piping the event through the given filters.
+ :rtype: None or tuple
"""
evt = evt_src, evt_type, evt_value
diff --git a/lib/taurus/core/util/excepthook.py b/lib/taurus/core/util/excepthook.py
index 5ef878e5..cd382dd1 100644
--- a/lib/taurus/core/util/excepthook.py
+++ b/lib/taurus/core/util/excepthook.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains a base class for exception hooks"""
+"""This module contains a base class for exception hooks
+"""
import sys
@@ -36,9 +37,10 @@ class BaseExceptHook(object):
"""A callable class that acts as an excepthook that handles an exception.
This base class simply calls the :obj:`sys.__excepthook__`
- :param hook_to: callable excepthook that will be called at the end of
- this hook handling [default: None]
- :type hook_to: callable"""
+ :param hook_to: callable excepthook that will be called at the end of this
+ hook handling [default: None]
+ :type hook_to: callable
+ """
def __init__(self, hook_to=None):
self._excepthook = hook_to
diff --git a/lib/taurus/core/util/init_bkcomp.py b/lib/taurus/core/util/init_bkcomp.py
index edf3f3f7..83a5a9f0 100644
--- a/lib/taurus/core/util/init_bkcomp.py
+++ b/lib/taurus/core/util/init_bkcomp.py
@@ -66,8 +66,11 @@ def dictFromSequence(seq):
"""Translates a sequence into a dictionary by converting each to elements of
the sequence (k,v) into a k:v pair in the dictionary
- :param seq: (sequence) any sequence object
- :return: (dict) dictionary built from the given sequence"""
+ :param seq: any sequence object
+ :type seq: sequence
+ :return: dictionary built from the given sequence
+ :rtype: dict
+ """
def _pairwise(iterable):
"""Utility method used by dictFromSequence"""
diff --git a/lib/taurus/core/util/init_lightweight.py b/lib/taurus/core/util/init_lightweight.py
index 74ffa4dd..c6b08baa 100644
--- a/lib/taurus/core/util/init_lightweight.py
+++ b/lib/taurus/core/util/init_lightweight.py
@@ -66,8 +66,11 @@ def dictFromSequence(seq):
"""Translates a sequence into a dictionary by converting each to elements of
the sequence (k,v) into a k:v pair in the dictionary
- :param seq: (sequence) any sequence object
- :return: (dict) dictionary built from the given sequence"""
+ :param seq: any sequence object
+ :type seq: sequence
+ :return: dictionary built from the given sequence
+ :rtype: dict
+ """
def _pairwise(iterable):
"""Utility method used by dictFromSequence"""
diff --git a/lib/taurus/core/util/lock.py b/lib/taurus/core/util/lock.py
index 218d3b9c..45ce5796 100644
--- a/lib/taurus/core/util/lock.py
+++ b/lib/taurus/core/util/lock.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module defines a *slow* lock class that provides additional debugging
-information"""
+information
+"""
import threading
import logging
diff --git a/lib/taurus/core/util/log.py b/lib/taurus/core/util/log.py
index 4529791a..3dec8686 100644
--- a/lib/taurus/core/util/log.py
+++ b/lib/taurus/core/util/log.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module contains a set of useful logging elements based on python's
-:mod:`logging` system."""
+:mod:`logging` system.
+"""
import io
import os
@@ -238,7 +239,8 @@ class TraceIt(LogIt):
def go(self):
print("Hello world")
- .. seealso:: :class:`LogIt`"""
+ .. seealso:: :class:`LogIt`
+ """
def __init__(self, showargs=False, showret=False):
LogIt.__init__(self, level=TRACE, showargs=showargs, showret=showret)
@@ -255,7 +257,8 @@ class DebugIt(LogIt):
def go(self):
print("Hello world")
- .. seealso:: :class:`LogIt`"""
+ .. seealso:: :class:`LogIt`
+ """
def __init__(self, showargs=False, showret=False):
LogIt.__init__(
@@ -274,7 +277,8 @@ class InfoIt(LogIt):
def go(self):
print("Hello world")
- .. seealso:: :class:`LogIt`"""
+ .. seealso:: :class:`LogIt`
+ """
def __init__(self, showargs=False, showret=False):
LogIt.__init__(
@@ -293,7 +297,8 @@ class WarnIt(LogIt):
def go(self):
print("Hello world")
- .. seealso:: :class:`LogIt`"""
+ .. seealso:: :class:`LogIt`
+ """
def __init__(self, showargs=False, showret=False):
LogIt.__init__(
@@ -312,7 +317,8 @@ class ErrorIt(LogIt):
def go(self):
print("Hello world")
- .. seealso:: :class:`LogIt`"""
+ .. seealso:: :class:`LogIt`
+ """
def __init__(self, showargs=False, showret=False):
LogIt.__init__(
@@ -331,7 +337,8 @@ class CriticalIt(LogIt):
def go(self):
print("Hello world")
- .. seealso:: :class:`LogIt`"""
+ .. seealso:: :class:`LogIt`
+ """
def __init__(self, showargs=False, showret=False):
LogIt.__init__(
@@ -382,7 +389,8 @@ class PrintIt(object):
class MemoryLogHandler(list, logging.handlers.BufferingHandler):
"""An experimental log handler that stores temporary records in memory.
- When flushed it passes the records to another handler"""
+ When flushed it passes the records to another handler
+ """
def __init__(self, capacity=1000):
list.__init__(self)
@@ -392,8 +400,10 @@ class MemoryLogHandler(list, logging.handlers.BufferingHandler):
def shouldFlush(self, record):
"""Determines if the given record should trigger the flush
- :param record: (logging.LogRecord) a log record
- :return: (bool) wheter or not the handler should be flushed
+ :param record: a log record
+ :type record: logging.LogRecord
+ :return: wheter or not the handler should be flushed
+ :rtype: bool
"""
return (
(len(self.buffer) >= self.capacity)
@@ -419,13 +429,14 @@ class LogExceptHook(BaseExceptHook):
"""A callable class that acts as an excepthook that logs the exception in
the python logging system.
- :param hook_to: callable excepthook that will be called at the end of
- this hook handling [default: None]
+ :param hook_to: callable excepthook that will be called at the end of this
+ hook handling [default: None]
:type hook_to: callable
:param name: logger name [default: None meaning use class name]
:type name: str
:param level: log level [default: logging.ERROR]
- :type level: int"""
+ :type level: int
+ """
def __init__(self, hook_to=None, name=None, level=logging.ERROR):
BaseExceptHook.__init__(self, hook_to=hook_to)
@@ -443,7 +454,8 @@ class LogExceptHook(BaseExceptHook):
class Logger(Object):
"""The taurus logger class. All taurus pertinent classes should inherit
directly or indirectly from this class if they need taurus logging
- facilities."""
+ facilities.
+ """
#: Internal usage
root_inited = False
@@ -495,9 +507,14 @@ class Logger(Object):
def __init__(self, name="", parent=None, format=None):
"""The Logger constructor
- :param name: (str) the logger name (default is empty string)
- :param parent: (Logger) the parent logger or None if no parent exists (default is None)
- :param format: (str) the log message format or None to use the default log format (default is None)
+ :param name: the logger name (default is empty string)
+ :type name: str
+ :param parent: the parent logger or None if no parent exists (default
+ is None)
+ :type parent: Logger
+ :param format: the log message format or None to use the default log
+ format (default is None)
+ :type format: str
"""
self.call__init__(Object)
@@ -524,7 +541,8 @@ class Logger(Object):
def cleanUp(self):
"""The cleanUp. Default implementation does nothing
- Overwrite when necessary"""
+ Overwrite when necessary
+ """
pass
@classmethod
@@ -558,7 +576,8 @@ class Logger(Object):
def addRootLogHandler(cls, h):
"""Adds a new handler to the root logger
- :param h: (logging.Handler) the new log handler
+ :param h: the new log handler
+ :type h: logging.Handler
"""
h.setFormatter(cls.getLogFormat())
cls.initRoot().addHandler(h)
@@ -567,7 +586,8 @@ class Logger(Object):
def removeRootLogHandler(cls, h):
"""Removes the given handler from the root logger
- :param h: (logging.Handler) the handler to be removed
+ :param h: the handler to be removed
+ :type h: logging.Handler
"""
cls.initRoot().removeHandler(h)
@@ -589,7 +609,8 @@ class Logger(Object):
def setLogLevel(cls, level):
"""sets the new log level (the root log level)
- :param level: (int) the new log level
+ :param level: the new log level
+ :type level: int
"""
cls.log_level = level
cls.initRoot().setLevel(level)
@@ -598,7 +619,8 @@ class Logger(Object):
def getLogLevel(cls):
"""Retuns the current log level (the root log level)
- :return: (int) a number representing the log level
+ :return: a number representing the log level
+ :rtype: int
"""
return cls.log_level
@@ -606,7 +628,8 @@ class Logger(Object):
def setLogFormat(cls, format):
"""sets the new log message format
- :param level: (str) the new log message format
+ :param level: the new log message format
+ :type level: str
"""
cls.log_format = logging.Formatter(format)
root_logger = cls.initRoot()
@@ -617,7 +640,8 @@ class Logger(Object):
def getLogFormat(cls):
"""Retuns the current log message format (the root log format)
- :return: (str) the log message format
+ :return: the log message format
+ :rtype: str
"""
return cls.log_format
@@ -635,8 +659,10 @@ class Logger(Object):
def addLevelName(cls, level_no, level_name):
"""Registers a new log level
- :param level_no: (int) the level number
- :param level_name: (str) the corresponding name
+ :param level_no: the level number
+ :type level_no: int
+ :param level_name: the corresponding name
+ :type level_name: str
"""
logging.addLevelName(level_no, level_name)
level_name = level_name.capitalize()
@@ -647,7 +673,8 @@ class Logger(Object):
def getRootLog(cls):
"""Retuns the root logger
- :return: (logging.Logger) the root logger
+ :return: the root logger
+ :rtype: logging.Logger
"""
return cls.initRoot()
@@ -669,14 +696,16 @@ class Logger(Object):
def getLogObj(self):
"""Returns the log object for this object
- :return: (logging.Logger) the log object
+ :return: the log object
+ :rtype: logging.Logger
"""
return self.log_obj
def getParent(self):
"""Returns the log parent for this object or None if no parent exists
- :return: (logging.Logger or None) the log parent for this object
+ :return: the log parent for this object
+ :rtype: logging.Logger or None
"""
if self.log_parent is None:
return None
@@ -685,7 +714,8 @@ class Logger(Object):
def getChildren(self):
"""Returns the log children for this object
- :return: (sequence<logging.Logger) the list of log children
+ :return: the list of log children
+ :rtype: sequence<logging.Logger
"""
children = []
for _, ref in self.log_children.items():
@@ -697,7 +727,8 @@ class Logger(Object):
def addChild(self, child):
"""Adds a new logging child
- :param child: (logging.Logger) the new child
+ :param child: the new child
+ :type child: logging.Logger
"""
if not self.log_children.get(id(child)):
self.log_children[id(child)] = weakref.ref(child)
@@ -705,7 +736,8 @@ class Logger(Object):
def addLogHandler(self, handler):
"""Registers a new handler in this object's logger
- :param handler: (logging.Handler) the new handler to be added
+ :param handler: the new handler to be added
+ :type handler: logging.Handler
"""
self.log_obj.addHandler(handler)
self.log_handlers.append(handler)
@@ -713,7 +745,8 @@ class Logger(Object):
def removeLogHandler(self, handler):
"""Removes the given handler from this object's logger
- :param handler: (logging.Handler) the handler to be removed
+ :param handler: the handler to be removed
+ :type handler: logging.Handler
"""
self.log_obj.removeHandler(handler)
self.log_handlers.remove(handler)
@@ -721,7 +754,8 @@ class Logger(Object):
def copyLogHandlers(self, other):
"""Copies the log handlers of other object to this object
- :param other: (object) object which contains 'log_handlers'
+ :param other: object which contains 'log_handlers'
+ :type other: object
"""
for handler in other.log_handlers:
self.addLogHandler(handler)
@@ -730,7 +764,8 @@ class Logger(Object):
"""Record a trace message in this object's logger. Accepted *args* and
*kwargs* are the same as :meth:`logging.Logger.log`.
- :param msg: (str) the message to be recorded
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
:param kw: list of keyword arguments
"""
@@ -740,10 +775,15 @@ class Logger(Object):
"""Log the usual traceback information, followed by a listing of all the
local variables in each frame.
- :param level: (int) the log level assigned to the traceback record
- :param extended: (bool) if True, the log record message will have multiple lines
+ :param level: the log level assigned to the traceback record
+ :type level: int
+ :param extended: if True, the log record message will have multiple
+ lines
+ :type extended: bool
+
- :return: (str) The traceback string representation
+ :return: The traceback string representation
+ :rtype: str
"""
out = traceback.format_exc()
if extended:
@@ -757,9 +797,12 @@ class Logger(Object):
"""Log the usual stack information, followed by a listing of all the
local variables in each frame.
- :param target: (int) the log level assigned to the record
+ :param target: the log level assigned to the record
+ :type target: int
+
- :return: (str) The stack string representation
+ :return: The stack string representation
+ :rtype: str
"""
out = self._format_stack()
self.log_obj.log(target, out)
@@ -817,8 +860,10 @@ class Logger(Object):
"""Record a log message in this object's logger. Accepted *args* and
*kwargs* are the same as :meth:`logging.Logger.log`.
- :param level: (int) the record level
- :param msg: (str) the message to be recorded
+ :param level: the record level
+ :type level: int
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
:param kw: list of keyword arguments
"""
@@ -828,7 +873,8 @@ class Logger(Object):
"""Record a debug message in this object's logger. Accepted *args* and
*kwargs* are the same as :meth:`logging.Logger.debug`.
- :param msg: (str) the message to be recorded
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
:param kw: list of keyword arguments
"""
@@ -838,7 +884,8 @@ class Logger(Object):
"""Record an info message in this object's logger. Accepted *args* and
*kwargs* are the same as :meth:`logging.Logger.info`.
- :param msg: (str) the message to be recorded
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
:param kw: list of keyword arguments
"""
@@ -848,7 +895,8 @@ class Logger(Object):
"""Record a warning message in this object's logger. Accepted *args* and
*kwargs* are the same as :meth:`logging.Logger.warning`.
- :param msg: (str) the message to be recorded
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
:param kw: list of keyword arguments
"""
@@ -870,16 +918,21 @@ class Logger(Object):
Also, an extra debug message can be recorded, followed by traceback
info.
- :param msg: (str) the message to be recorded (if None passed, it will
- be constructed using dep (and, optionally, alt and rel)
- :param dep: (str) name of deprecated feature (in case msg is None)
- :param alt: (str) name of alternative feature (in case msg is None)
- :param rel: (str) name of release from which the feature was
- deprecated (in case msg is None)
- :param dbg_msg: (str) msg for debug (or None to log only the warning)
+ :param msg: the message to be recorded (if None passed, it will be
+ constructed using dep (and, optionally, alt and rel)
+ :type msg: str
+ :param dep: name of deprecated feature (in case msg is None)
+ :type dep: str
+ :param alt: name of alternative feature (in case msg is None)
+ :type alt: str
+ :param rel: name of release from which the feature was deprecated (in
+ case msg is None)
+ :type rel: str
+ :param dbg_msg: msg for debug (or None to log only the warning)
+ :type dbg_msg: str
:param _callerinfo: for internal use only. Do not use this argument.
:param kw: any additional keyword arguments, are passed to
- :meth:`logging.Logger.warning`
+ :meth:`logging.Logger.warning`
"""
if msg is None:
if dep is None:
@@ -920,7 +973,8 @@ class Logger(Object):
"""Record an error message in this object's logger. Accepted *args* and
*kwargs* are the same as :meth:`logging.Logger.error`.
- :param msg: (str) the message to be recorded
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
:param kw: list of keyword arguments
"""
@@ -930,7 +984,8 @@ class Logger(Object):
"""Record a fatal message in this object's logger. Accepted *args* and
*kwargs* are the same as :meth:`logging.Logger.fatal`.
- :param msg: (str) the message to be recorded
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
:param kw: list of keyword arguments
"""
@@ -940,7 +995,8 @@ class Logger(Object):
"""Record a critical message in this object's logger. Accepted *args* and
*kwargs* are the same as :meth:`logging.Logger.critical`.
- :param msg: (str) the message to be recorded
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
:param kw: list of keyword arguments
"""
@@ -951,7 +1007,8 @@ class Logger(Object):
exception information.. Accepted *args* are the same as
:meth:`logging.Logger.exception`.
- :param msg: (str) the message to be recorded
+ :param msg: the message to be recorded
+ :type msg: str
:param args: list of arguments
"""
self.log_obj.exception(msg, *args)
@@ -979,21 +1036,24 @@ class Logger(Object):
def getLogName(self):
"""Gets the log name for this object
- :return: (str) the log name
+ :return: the log name
+ :rtype: str
"""
return self.log_name
def getLogFullName(self):
"""Gets the full log name for this object
- :return: (str) the full log name
+ :return: the full log name
+ :rtype: str
"""
return self.log_full_name
def changeLogName(self, name):
"""Change the log name for this object.
- :param name: (str) the new log name
+ :param name: the new log name
+ :type name: str
"""
self.log_name = name
p = self.getParent()
diff --git a/lib/taurus/core/util/object.py b/lib/taurus/core/util/object.py
index 78f85e76..0a54186a 100644
--- a/lib/taurus/core/util/object.py
+++ b/lib/taurus/core/util/object.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the base Object class for taurus."""
+"""This module contains the base Object class for taurus.
+"""
__all__ = ["Object"]
@@ -38,7 +39,8 @@ class Object(object):
"""Method to be called from subclasses to call superclass corresponding
__init__ method. This method ensures that classes from diamond like
class hierarquies don't call their super classes __init__ more than
- once."""
+ once.
+ """
if "inited_class_list" not in self.__dict__:
self.inited_class_list = []
diff --git a/lib/taurus/core/util/parse_args.py b/lib/taurus/core/util/parse_args.py
index 36c30abf..1371a194 100644
--- a/lib/taurus/core/util/parse_args.py
+++ b/lib/taurus/core/util/parse_args.py
@@ -32,10 +32,10 @@ def parse_args(s, strip_pars=False):
corresponding args and kwargs.
:param s: string representing arguments to a method
- :param strip_pars: (bool) If True, expect s to include surrounding
- parenthesis
+ :param strip_pars: If True, expect s to include surrounding parenthesis
+ :type strip_pars: bool
:return: args, kwargs (a list of positional arguments and a dict of keyword
- arguments)
+ arguments)
"""
s = s.strip()
if strip_pars:
diff --git a/lib/taurus/core/util/plugin.py b/lib/taurus/core/util/plugin.py
index 89263d36..7516e547 100644
--- a/lib/taurus/core/util/plugin.py
+++ b/lib/taurus/core/util/plugin.py
@@ -85,23 +85,25 @@ def selectEntryPoints(group=None, include=(".*",), exclude=()):
wrapped in an :class:`EntryPointAlike` instance and also included in the
selection.
- :param group: (str) entry point group name from which the entry points
- are obtained.
- :param include: (`tuple`). The members of the tuple can either be
- patterns (both in the form of strings or of
- :class:`re.Pattern` objects), which will be matched against
- registered names in group; or EntryPoint-like objects which
- will be included as they are; or an arbitrary object which
- will be wrapped as an EntryPoint-like object before being
- included. Default is `(".*",)`, which matches all
- registered names in group and the sort is purely
- alphabetical.
- :param exclude: (`tuple`). Regexp patterns (either `str` or
- :class:`re.Pattern` objects) matching names to be excluded.
- Default is `()`, so no entry point is excluded.
-
- :return: (list of :class:`pkg_resources.EntryPoint`) the selected entry
- points.
+ :param group: entry point group name from which the entry points are
+ obtained.
+ :type group: str
+ :param include: The members of the tuple can either be patterns (both in
+ the form of strings or of :class:`re.Pattern` objects), which will be
+ matched against registered names in group; or EntryPoint-like objects
+ which will be included as they are; or an arbitrary object which will
+ be wrapped as an EntryPoint-like object before being included. Default
+ is `(".*",)`, which matches all registered names in group and the sort
+ is purely alphabetical.
+ :type include: `tuple`
+ :param exclude: Regexp patterns (either `str` or :class:`re.Pattern`
+ objects) matching names to be excluded. Default is `()`, so no entry
+ point is excluded.
+ :type exclude: `tuple`
+
+
+ :return: the selected entry points.
+ :rtype: list of :class:`pkg_resources.EntryPoint`
"""
ret = []
diff --git a/lib/taurus/core/util/prop.py b/lib/taurus/core/util/prop.py
index 3a5f0b35..3fbe903a 100644
--- a/lib/taurus/core/util/prop.py
+++ b/lib/taurus/core/util/prop.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains a decorator to simplify the use of property."""
+"""This module contains a decorator to simplify the use of property.
+"""
__all__ = ["propertx"]
diff --git a/lib/taurus/core/util/property_parser.py b/lib/taurus/core/util/property_parser.py
index a93f314d..41163df9 100644
--- a/lib/taurus/core/util/property_parser.py
+++ b/lib/taurus/core/util/property_parser.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This is an experimental property parser"""
+"""This is an experimental property parser
+"""
import os
import ply.lex as lex
@@ -130,7 +131,8 @@ def p_error(p):
def p_property_file(p):
"""property_file : statement_list
- |"""
+ |
+ """
if len(p) == 1:
p[0] = {}
else:
@@ -155,7 +157,8 @@ def p_statement_assign(p):
def p_value(p):
"""value : atomic
- | list"""
+ | list
+ """
p[0] = p[1]
@@ -163,7 +166,8 @@ def p_value_atomic(p):
"""atomic : KEY
| STRING
| NUMBER
- | boolean"""
+ | boolean
+ """
p[0] = p[1]
@@ -171,7 +175,8 @@ def p_value_boolean(p):
"""boolean : true
| false
| yes
- | no"""
+ | no
+ """
v = p[1].lower()
p[0] = v in ("true", "yes")
diff --git a/lib/taurus/core/util/propertyfile.py b/lib/taurus/core/util/propertyfile.py
index a7f9e842..fa8f7ce4 100644
--- a/lib/taurus/core/util/propertyfile.py
+++ b/lib/taurus/core/util/propertyfile.py
@@ -76,7 +76,8 @@ class Properties(object):
def __parse(self, lines):
"""Parse a list of lines and create
- an internal property dictionary"""
+ an internal property dictionary
+ """
# Every line in the file must consist of either a comment
# or a key-value pair. A key-value pair is a line consisting
@@ -265,13 +266,15 @@ class Properties(object):
def propertyNames(self):
"""Return an iterator over all the keys of the property
- dictionary, i.e the names of the properties"""
+ dictionary, i.e the names of the properties
+ """
return list(self._props.keys())
def list(self, out=sys.stdout):
"""Prints a listing of the properties to the
- stream 'out' which defaults to the standard output"""
+ stream 'out' which defaults to the standard output
+ """
out.write("-- listing properties --\n")
for key, value in list(self._props.items()):
@@ -279,7 +282,8 @@ class Properties(object):
def store(self, out, header=""):
"""Write the properties list to the stream 'out' along
- with the optional 'header'"""
+ with the optional 'header'
+ """
if out.mode[0] != "w":
raise ValueError("Steam should be opened in write mode!")
@@ -312,7 +316,8 @@ class Properties(object):
def __getattr__(self, name):
"""For attributes not found in self, redirect
- to the properties dictionary"""
+ to the properties dictionary
+ """
try:
return self.__dict__[name]
diff --git a/lib/taurus/core/util/remotelogmonitor.py b/lib/taurus/core/util/remotelogmonitor.py
index 59e394f9..7393caa9 100644
--- a/lib/taurus/core/util/remotelogmonitor.py
+++ b/lib/taurus/core/util/remotelogmonitor.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Useful module for remote logging"""
+"""Useful module for remote logging
+"""
import time
import socket
diff --git a/lib/taurus/core/util/report/__init__.py b/lib/taurus/core/util/report/__init__.py
index 82389e25..cb6709c1 100644
--- a/lib/taurus/core/util/report/__init__.py
+++ b/lib/taurus/core/util/report/__init__.py
@@ -23,6 +23,7 @@
##
#############################################################################
-"""This module provides a panel to display taurus messages"""
+"""This module provides a panel to display taurus messages
+"""
from .report import *
diff --git a/lib/taurus/core/util/report/report.py b/lib/taurus/core/util/report/report.py
index 93bf6b0d..6c72384f 100644
--- a/lib/taurus/core/util/report/report.py
+++ b/lib/taurus/core/util/report/report.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a panel to display taurus messages"""
+"""This module provides a panel to display taurus messages
+"""
__all__ = ["TaurusMessageReportHandler"]
diff --git a/lib/taurus/core/util/singleton.py b/lib/taurus/core/util/singleton.py
index 8f9f8af2..91cf338d 100644
--- a/lib/taurus/core/util/singleton.py
+++ b/lib/taurus/core/util/singleton.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module contains a class which can be used as a super class for all
-classes that need to implement the Singleton design pattern."""
+classes that need to implement the Singleton design pattern.
+"""
__all__ = ["Singleton"]
diff --git a/lib/taurus/core/util/sourcecode.py b/lib/taurus/core/util/sourcecode.py
index 63cbc765..91088532 100644
--- a/lib/taurus/core/util/sourcecode.py
+++ b/lib/taurus/core/util/sourcecode.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Source code text utilities"""
+"""Source code text utilities
+"""
__all__ = [
"get_eol_chars",
diff --git a/lib/taurus/core/util/tablepprint.py b/lib/taurus/core/util/tablepprint.py
index 1fbbc613..49ea42cb 100644
--- a/lib/taurus/core/util/tablepprint.py
+++ b/lib/taurus/core/util/tablepprint.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Adapted from http://code.activestate.com/recipes/267662/"""
+"""Adapted from http://code.activestate.com/recipes/267662/
+"""
from functools import reduce
import operator
@@ -47,17 +48,17 @@ def indent(
"""Indents a table by column.
:param rows: A sequence of sequences of items, one sequence per row.
:param hasHeader: True if the first row consists of the columns' names.
- :param headerChar: Character to be used for the row separator line
- (if hasHeader==True or separateRows==True).
+ :param headerChar: Character to be used for the row separator line (if
+ hasHeader==True or separateRows==True).
:param delim: The column delimiter.
- :param justify: Determines how are data justified in their column.
- Valid values are 'left','right' and 'center'.
+ :param justify: Determines how are data justified in their column. Valid
+ values are 'left','right' and 'center'.
:param separateRows: True if rows are to be separated by a line of
- 'headerChar's.
+ 'headerChar's.
:param prefix: A string prepended to each printed row.
:param postfix: A string appended to each printed row.
- :param wrapfunc: A function f(text) for wrapping text;
- each element in the table is first wrapped by this function.
+ :param wrapfunc: A function f(text) for wrapping text; each element in the
+ table is first wrapped by this function.
:return: a list of strings. One for each row of the table
"""
# closure for breaking logical rows to physical, using wrapfunc
@@ -138,7 +139,8 @@ def wrap_onspace(text, width):
def wrap_onspace_strict(text, width):
"""Similar to wrap_onspace, but enforces the width constraint:
- words longer than width are split."""
+ words longer than width are split.
+ """
wordRegex = re.compile(r"\S{" + str(width) + r",}")
return wrap_onspace(
wordRegex.sub(lambda m: wrap_always(m.group(), width), text), width
@@ -147,7 +149,8 @@ def wrap_onspace_strict(text, width):
def wrap_always(text, width):
"""A simple word-wrap function that wraps text on exactly width characters.
- It doesn't split the text in words."""
+ It doesn't split the text in words.
+ """
return "\n".join(
[
text[width * i : width * (i + 1)]
diff --git a/lib/taurus/core/util/tb.py b/lib/taurus/core/util/tb.py
index e87920de..4b257502 100644
--- a/lib/taurus/core/util/tb.py
+++ b/lib/taurus/core/util/tb.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module contains a set of useful traceback elements based on python's
-:mod:`traceback` system."""
+:mod:`traceback` system.
+"""
import sys
import traceback
diff --git a/lib/taurus/core/util/test/test_codecs.py b/lib/taurus/core/util/test/test_codecs.py
index 9a4e9993..c826614f 100644
--- a/lib/taurus/core/util/test/test_codecs.py
+++ b/lib/taurus/core/util/test/test_codecs.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.util.codecs"""
+"""Test for taurus.core.util.codecs
+"""
# __all__ = []
diff --git a/lib/taurus/core/util/test/test_timer.py b/lib/taurus/core/util/test/test_timer.py
index 4334e78f..02fe394b 100644
--- a/lib/taurus/core/util/test/test_timer.py
+++ b/lib/taurus/core/util/test/test_timer.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.core.util.timer"""
+"""Test for taurus.core.util.timer
+"""
# __all__ = []
@@ -93,7 +94,8 @@ class TestTimer:
def _callback(self, sleep=0, n=5):
"""store times at which it has been called, and signal when n calls
- have been done. If sleep>0 is passed, sleep that much in each call"""
+ have been done. If sleep>0 is passed, sleep that much in each call
+ """
self.__calltimes.append(time.time())
self.__count += 1
time.sleep(sleep)
diff --git a/lib/taurus/core/util/threadpool.py b/lib/taurus/core/util/threadpool.py
index 7e807878..3785324d 100644
--- a/lib/taurus/core/util/threadpool.py
+++ b/lib/taurus/core/util/threadpool.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""adapted from http://code.activestate.com/recipes/576576/"""
+"""adapted from http://code.activestate.com/recipes/576576/
+"""
from threading import Thread, currentThread
from queue import Queue
diff --git a/lib/taurus/core/util/timer.py b/lib/taurus/core/util/timer.py
index 487c8a78..492fe80c 100644
--- a/lib/taurus/core/util/timer.py
+++ b/lib/taurus/core/util/timer.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains a :class:`Timer` class"""
+"""This module contains a :class:`Timer` class
+"""
__all__ = ["Timer"]
diff --git a/lib/taurus/core/util/user.py b/lib/taurus/core/util/user.py
index ca5e4b32..9dc2f753 100644
--- a/lib/taurus/core/util/user.py
+++ b/lib/taurus/core/util/user.py
@@ -27,7 +27,8 @@
Finds out user inf (currently just the logged user name) for Windows and
Posix machines. sets a USER_NAME variable containing the logged user name
defines a UNKNOWN_USER variable to which username falls back.
-It also provides the getSystemUserName() function"""
+It also provides the getSystemUserName() function
+"""
__all__ = ["getSystemUserName", "USER_NAME", "UNKNOWN_USER"]
@@ -45,7 +46,8 @@ def getSystemUserName():
Posix machines. sets a USER_NAME variable containing the logged user name
defines a UNKNOWN_USER variable to which username falls back.
- :return: (str) current user name
+ :return: current user name
+ :rtype: str
"""
try:
return getpass.getuser()
diff --git a/lib/taurus/core/util/whichexecutable.py b/lib/taurus/core/util/whichexecutable.py
index 56b31cdf..3410d4cb 100644
--- a/lib/taurus/core/util/whichexecutable.py
+++ b/lib/taurus/core/util/whichexecutable.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Find path of executable specified by filename"""
+"""Find path of executable specified by filename
+"""
__all__ = ["whichfile"]
@@ -47,12 +48,15 @@ def whichfile(filename, exts=None):
# or, on a winXP machine:
whichfile('command') --> 'C:\\WINDOWS\\system32\\command.COM'
- :param filename: (str) executable name.
- :param exts: (list<str>) a list of valid executable extensions.
- If None given, the PATHEXT environmental variable is used
- if available.
+ :param filename: executable name.
+ :type filename: str
+ :param exts: a list of valid executable extensions. If None given, the
+ PATHEXT environmental variable is used if available.
+ :type exts: list<str>
- :return: (str) absolute path to the executable in the file system
+
+ :return: absolute path to the executable in the file system
+ :rtype: str
"""
path = os.getenv("PATH", "").split(os.path.pathsep)
if exts is None:
diff --git a/lib/taurus/core/util/wrap.py b/lib/taurus/core/util/wrap.py
index f323f2e5..f82f12e0 100644
--- a/lib/taurus/core/util/wrap.py
+++ b/lib/taurus/core/util/wrap.py
@@ -23,7 +23,8 @@
##
#############################################################################
-""""""
+"""
+"""
__all__ = ["wraps", "wrapped", "is_wrapping", "is_wrapped"]
@@ -36,7 +37,8 @@ __WRAPPER = "__wrapper__"
def wraps(wrapped, *args, **kwargs):
"""A wrap decorator which stores in the returned function a reference to
- the wrapped function (in member '__wrapped__')"""
+ the wrapped function (in member '__wrapped__')
+ """
wrapper = _wraps(wrapped, *args, **kwargs)
setattr(wrapper, __WRAPPED, weakref.ref(wrapped))
setattr(wrapped, __WRAPPER, weakref.ref(wrapper))
@@ -55,7 +57,8 @@ def is_wrapped(wrapped):
def wrapped(wrapper, recursive=True):
"""Returns the wrapped function around the given wrapper. If the given
- callable is not "wrapping" any function, the wrapper itself is returned"""
+ callable is not "wrapping" any function, the wrapper itself is returned
+ """
if is_wrapping(wrapper):
_wrapped = wrapper.__wrapped__()
else:
diff --git a/lib/taurus/external/qt/Qt.py b/lib/taurus/external/qt/Qt.py
index c6dfebbf..5f7f9ef8 100644
--- a/lib/taurus/external/qt/Qt.py
+++ b/lib/taurus/external/qt/Qt.py
@@ -23,7 +23,8 @@
##
##############################################################################
-"""This module exposes the Qt module"""
+"""This module exposes the Qt module
+"""
from .QtCore import *
from .QtGui import *
diff --git a/lib/taurus/external/qt/QtHelp.py b/lib/taurus/external/qt/QtHelp.py
index abbdc985..2b3aec2c 100644
--- a/lib/taurus/external/qt/QtHelp.py
+++ b/lib/taurus/external/qt/QtHelp.py
@@ -5,7 +5,8 @@
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
-"""QtHelp Wrapper."""
+"""QtHelp Wrapper.
+"""
from . import PYQT5
from . import PYSIDE2
diff --git a/lib/taurus/external/qt/QtSvg.py b/lib/taurus/external/qt/QtSvg.py
index 9049b1b5..3b0a548e 100644
--- a/lib/taurus/external/qt/QtSvg.py
+++ b/lib/taurus/external/qt/QtSvg.py
@@ -5,7 +5,8 @@
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
-"""Provides QtSvg classes and functions."""
+"""Provides QtSvg classes and functions.
+"""
# Local imports
from . import PYSIDE2, PYQT5, PythonQtError
diff --git a/lib/taurus/external/qt/QtWebKit.py b/lib/taurus/external/qt/QtWebKit.py
index 14036eab..e004d23b 100644
--- a/lib/taurus/external/qt/QtWebKit.py
+++ b/lib/taurus/external/qt/QtWebKit.py
@@ -23,7 +23,8 @@
##
##############################################################################
-"""This module exposes QtWebKit module"""
+"""This module exposes QtWebKit module
+"""
from . import PYQT5, PYSIDE2, PythonQtError
diff --git a/lib/taurus/external/qt/__init__.py b/lib/taurus/external/qt/__init__.py
index 7f5c42b8..32e02f13 100644
--- a/lib/taurus/external/qt/__init__.py
+++ b/lib/taurus/external/qt/__init__.py
@@ -23,7 +23,8 @@
##
##############################################################################
-"""This module exposes PyQt4/PyQt5/PySide module"""
+"""This module exposes PyQt4/PyQt5/PySide module
+"""
__all__ = ["initialize", "API_NAME", "getQtName", "getQt", "requires"]
diff --git a/lib/taurus/qt/__init__.py b/lib/taurus/qt/__init__.py
index 7fc427cc..28ca0729 100644
--- a/lib/taurus/qt/__init__.py
+++ b/lib/taurus/qt/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""The taurus.qt submodule. It contains qt-specific part of taurus"""
+"""The taurus.qt submodule. It contains qt-specific part of taurus
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtcore/__init__.py b/lib/taurus/qt/qtcore/__init__.py
index 132ec91b..64001400 100644
--- a/lib/taurus/qt/qtcore/__init__.py
+++ b/lib/taurus/qt/qtcore/__init__.py
@@ -23,4 +23,5 @@
##
#############################################################################
-"""The taurus.qt.qtcore submodule. It contains non-gui components of taurus.qt"""
+"""The taurus.qt.qtcore submodule. It contains non-gui components of taurus.qt
+"""
diff --git a/lib/taurus/qt/qtcore/communication/__init__.py b/lib/taurus/qt/qtcore/communication/__init__.py
index d7c7d2c4..5bb3b908 100644
--- a/lib/taurus/qt/qtcore/communication/__init__.py
+++ b/lib/taurus/qt/qtcore/communication/__init__.py
@@ -24,6 +24,7 @@
#############################################################################
"""The taurus.qt.qtcore.communication submodule. It contains non-gui components
-of taurus.qt"""
+of taurus.qt
+"""
from .communication import *
diff --git a/lib/taurus/qt/qtcore/communication/communication.py b/lib/taurus/qt/qtcore/communication/communication.py
index 525a57b9..f72327ec 100644
--- a/lib/taurus/qt/qtcore/communication/communication.py
+++ b/lib/taurus/qt/qtcore/communication/communication.py
@@ -60,8 +60,10 @@ class DataModel(QtCore.QObject):
def __init__(self, parent, dataUID, defaultData=None):
"""
creator
- :param parent: (QObject) the object's parent
- :param dataUID: (str) a unique identifier for the Data Model
+ :param parent: the object's parent
+ :type parent: QObject
+ :param dataUID: a unique identifier for the Data Model
+ :type dataUID: str
"""
QtCore.QObject.__init__(self, parent)
self.__dataUID = dataUID
@@ -78,7 +80,8 @@ class DataModel(QtCore.QObject):
"""
returns the data unique identifier
- :return: (str)
+ :return:
+ :rtype: str
"""
return self.__dataUID
@@ -86,7 +89,8 @@ class DataModel(QtCore.QObject):
"""
Returns the data object.
- :return: (object) the data object
+ :return: the data object
+ :rtype: object
"""
return self.__data
@@ -94,7 +98,8 @@ class DataModel(QtCore.QObject):
"""
sets the data object and emits a "dataChanged" signal with the data as the parameter
- :param data: (object) the new value for the Model's data
+ :param data: the new value for the Model's data
+ :type data: object
"""
self.__data = data
self.__isDataSet = True
@@ -105,12 +110,15 @@ class DataModel(QtCore.QObject):
Registers the given slot method to receive notifications whenever the
data is changed.
- :param slot: (callable) a method that will be called when the data changes.
- This slot will be the receiver of a signal which has the
- data as its first argument.
- :param readOnConnect: (bool) if True (default) the slot will be called
- immediately with the current value of the data
- if the data has been already initialized
+ :param slot: a method that will be called when the data changes. This
+ slot will be the receiver of a signal which has the data as its
+ first argument.
+ :type slot: callable
+ :param readOnConnect: if True (default) the slot will be called
+ immediately with the current value of the data if the data has been
+ already initialized
+ :type readOnConnect: bool
+
.. seealso:: :meth:`connectWriter`, :meth:`getData`
"""
@@ -127,9 +135,11 @@ class DataModel(QtCore.QObject):
then expected to emit a `QtCore.SIGNAL(signalname)` with the new data as the
first parameter.
- :param writer: (QObject) object that will change the data
- :param signalname: (str) the signal name that will notify changes
- of the data
+ :param writer: object that will change the data
+ :type writer: QObject
+ :param signalname: the signal name that will notify changes of the data
+ :type signalname: str
+
.. seealso:: :meth:`connectReader`, :meth:`setData`
"""
@@ -143,8 +153,11 @@ class DataModel(QtCore.QObject):
def disconnectWriter(self, writer, signalname):
"""unregister a writer from this data model
- :param writer: (QObject) object to unregister
- :param signalname: (str) the signal that was registered
+ :param writer: object to unregister
+ :type writer: QObject
+ :param signalname: the signal that was registered
+ :type signalname: str
+
.. seealso:: :meth:`SharedDataManager.disconnectWriter`
"""
@@ -155,7 +168,9 @@ class DataModel(QtCore.QObject):
"""
unregister a reader
- :param slot: (callable) the slot to which this was connected
+ :param slot: the slot to which this was connected
+ :type slot: callable
+
.. seealso:: :meth:`SharedDataManager.disconnectReader`, :meth:`getData`
"""
@@ -165,7 +180,9 @@ class DataModel(QtCore.QObject):
def isDataSet(self):
"""Whether the data has been set at least once or if it is uninitialized
- :return: (bool) True if the data has been set. False it is uninitialized"""
+ :return: True if the data has been set. False it is uninitialized
+ :rtype: bool
+ """
return self.__isDataSet
def info(self):
@@ -182,14 +199,16 @@ class DataModel(QtCore.QObject):
def readerCount(self):
"""returns the number of currently registered readers of this model
- :return: (int)
+ :return:
+ :rtype: int
"""
return len(self.__readerSlots)
def writerCount(self):
"""returns the number of currently registered writers of this model
- :return: (int)
+ :return:
+ :rtype: int
"""
return len(self.__writerSignals)
@@ -214,9 +233,13 @@ class SharedDataManager(QtCore.QObject):
.. note:: This is a private method. You are probably more interested
in using :meth:`connectReader` and :meth:`connectWriter`
- :param dataUID: (str) the unique identifier of the data
+ :param dataUID: the unique identifier of the data
+ :type dataUID: str
+
+
+ :return:
+ :rtype: DataModel
- :return: (DataModel)
.. seealso:: :meth:`connectReader`, :meth:`connectWriter`, :class:`DataModel`
"""
@@ -232,10 +255,15 @@ class SharedDataManager(QtCore.QObject):
.. note:: The underlying :class:`DataModel` object may cease to exist if
all its readers and writers are unregistered.
- :param dataUID: (str) the unique identifier of the data
- :param callback: (callable) same as in :class:`weakref.ref` callback parameter
+ :param dataUID: the unique identifier of the data
+ :type dataUID: str
+ :param callback: same as in :class:`weakref.ref` callback parameter
+ :type callback: callable
+
+
+ :return:
+ :rtype: weakref.proxy or None
- :return: (weakref.proxy or None)
.. seealso:: :meth:`connectReader`, :meth:`connectWriter`, :class:`DataModel`
"""
@@ -252,15 +280,21 @@ class SharedDataManager(QtCore.QObject):
Note that it returns the :meth:`DataModel.getData` method for the given data
UID, which can be used for reading the data at any moment.
- :param dataUID: (str) the unique identifier of the data
- :param slot: (callable) a method that will be called when the data changes
- this slot will be the receiver of a signal which has the
- data as its first argument.
- :param readOnConnect: (bool) if True (default) the slot will be called
- immediately with the current value of the data
- if the data has been already initialized
+ :param dataUID: the unique identifier of the data
+ :type dataUID: str
+ :param slot: a method that will be called when the data changes this
+ slot will be the receiver of a signal which has the data as its
+ first argument.
+ :type slot: callable
+ :param readOnConnect: if True (default) the slot will be called
+ immediately with the current value of the data if the data has been
+ already initialized
+ :type readOnConnect: bool
+
+
+ :return: a callable that can be used for reading the data
+ :rtype: callable
- :return: (callable) a callable that can be used for reading the data
.. seealso:: :meth:`connectWriter`, :meth:`__getDataModel`
"""
@@ -280,14 +314,18 @@ class SharedDataManager(QtCore.QObject):
Note that it returns the :meth:`DataModel.setData` method for the given data
UID, which can be used for changing the data at any moment.
- :param dataUID: (str) the unique identifier of the data
- :param writer: (QObject) object that will change the data
- :param signalname: (str) the signal name that will notify changes
- of the data
+ :param dataUID: the unique identifier of the data
+ :type dataUID: str
+ :param writer: object that will change the data
+ :type writer: QObject
+ :param signalname: the signal name that will notify changes of the data
+ :type signalname: str
+
+
+ :return: a callable that can be used for setting the data. When using
+ it, one parameter has to be passed containing the new data
+ :rtype: callable
- :return: (callable) a callable that can be used for setting the data.
- When using it, one parameter has to be passed containing the
- new data
.. seealso:: :meth:`connectWriter`, :meth:`__getDataModel`
"""
@@ -301,9 +339,13 @@ class SharedDataManager(QtCore.QObject):
def disconnectWriter(self, dataUID, writer, signalname):
"""Unregister the given object as writer of the shared data
- :param dataUID: (str) the unique identifier of the data
- :param writer: (QObject) object to unregister
- :param signalname: (str) the signal that was registered
+ :param dataUID: the unique identifier of the data
+ :type dataUID: str
+ :param writer: object to unregister
+ :type writer: QObject
+ :param signalname: the signal that was registered
+ :type signalname: str
+
.. seealso:: :meth:`DataModel.disconnectWriter`
"""
@@ -315,8 +357,11 @@ class SharedDataManager(QtCore.QObject):
def disconnectReader(self, dataUID, slot):
"""Unregister the given method as data receiver
- :param dataUID: (str) the unique identifier of the data
- :param slot: (str) the slot that was registered
+ :param dataUID: the unique identifier of the data
+ :type dataUID: str
+ :param slot: the slot that was registered
+ :type slot: str
+
.. seealso:: :meth:`DataModel.disconnectReader`
"""
@@ -331,7 +376,8 @@ class SharedDataManager(QtCore.QObject):
reflects the situation at the moment of calling this method: a given
DataModel may die at any moment if there are no references to it.
- :returns: (list<str>) UIDs of currently shared data.
+ :return: UIDs of currently shared data.
+ :rtype: list<str>
"""
return list(self.__models.keys())
diff --git a/lib/taurus/qt/qtcore/configuration/__init__.py b/lib/taurus/qt/qtcore/configuration/__init__.py
index 7e905dec..c1401ab1 100644
--- a/lib/taurus/qt/qtcore/configuration/__init__.py
+++ b/lib/taurus/qt/qtcore/configuration/__init__.py
@@ -24,6 +24,7 @@
#############################################################################
"""This module provides the set of base classes designed to provide
-configuration features to the classes that inherit from them"""
+configuration features to the classes that inherit from them
+"""
from .configuration import *
diff --git a/lib/taurus/qt/qtcore/configuration/configuration.py b/lib/taurus/qt/qtcore/configuration/configuration.py
index b0093dbf..fb53219e 100644
--- a/lib/taurus/qt/qtcore/configuration/configuration.py
+++ b/lib/taurus/qt/qtcore/configuration/configuration.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides the set of base classes designed to provide
-configuration features to the classes that inherit from them"""
+configuration features to the classes that inherit from them
+"""
__all__ = ["configurableProperty", "BaseConfigurableClass"]
@@ -127,7 +128,6 @@ class BaseConfigurableClass(object):
since it automates all the steps for *saving properties when closing* and
*restoring the settings on startup*. It also provides a mechanism for
implementing "perspectives" in your application.
-
"""
defaultConfigRecursionDepth = -1
@@ -141,9 +141,12 @@ class BaseConfigurableClass(object):
def isTaurusConfig(x):
"""Checks if the given argument has the structure of a configdict
- :param x: (object) object to test
+ :param x: object to test
+ :type x: object
+
- :return: (bool) True if it is a configdict, False otherwise.
+ :return: True if it is a configdict, False otherwise.
+ :rtype: bool
"""
if not isinstance(x, dict):
return False
@@ -181,16 +184,18 @@ class BaseConfigurableClass(object):
import pickle
s = pickle.dumps(widget.createConfig()) #s is a string that can be stored
- :param alllowUnpickable: (bool) if False the returned dict is
- guaranteed to be a pickable object. This is
- the default and preferred option because it
- allows the serialization as a string that can
- be directly stored in a QSetting. If True, this
- limitation is not enforced, which allows to
- use more complex objects as values (but limits
- its persistence).
+ :param alllowUnpickable: if False the returned dict is guaranteed to be
+ a pickable object. This is the default and preferred option because
+ it allows the serialization as a string that can be directly stored
+ in a QSetting. If True, this limitation is not enforced, which
+ allows to use more complex objects as values (but limits its
+ persistence).
+ :type alllowUnpickable: bool
+
+
+ :return: configurations (which can be loaded with :meth:`applyConfig`).
+ :rtype: dict<str,object>
- :return: (dict<str,object>) configurations (which can be loaded with :meth:`applyConfig`).
.. seealso: :meth:`applyConfig` , :meth:`registerConfigurableItem`, meth:`createQConfig`, meth:`saveConfigFile`
"""
@@ -215,14 +220,16 @@ class BaseConfigurableClass(object):
this method, although it can be reimplemented in children classes to support
very specific configurations.
- :param configdict: (dict)
- :param depth: (int) If depth = 0, applyConfig will only be called
- for this object, and not for any other object registered
- via :meth:`registerConfigurableItem`. If depth > 0,
- applyConfig will be called recursively as many times as
- the depth value. If depth < 0 (default, see note), no
- limit is imposed to recursion (i.e., it will recurse for
- as deep as there are registered items).
+ :param configdict:
+ :type configdict: dict
+ :param depth: If depth = 0, applyConfig will only be called for this
+ object, and not for any other object registered via
+ :meth:`registerConfigurableItem`. If depth > 0, applyConfig will be
+ called recursively as many times as the depth value. If depth < 0
+ (default, see note), no limit is imposed to recursion (i.e., it
+ will recurse for as deep as there are registered items).
+ :type depth: int
+
.. note:: the default recursion depth can be tweaked in derived classes
by changing the class property `defaultConfigRecursionDepth`
@@ -250,7 +257,8 @@ class BaseConfigurableClass(object):
"""returns an ordered list of the names of currently registered
configuration items (delegates and properties)
- :return: (list<unicode>)
+ :return:
+ :rtype: list<unicode>
"""
return self.__configurableItemNames
@@ -282,9 +290,13 @@ class BaseConfigurableClass(object):
- `applyConfig` (as provided by, e.g., BaseConfigurableClass)
- `objectName` (as provided by, e.g., QObject)
- :param delegate: (BaseConfigurableClass) The delegate object to be registered.
- :param name: (str) The name to be used as a key for this item in the configuration
- dictionary. If None given, the object name is used by default.
+ :param delegate: The delegate object to be registered.
+ :type delegate: BaseConfigurableClass
+ :param name: The name to be used as a key for this item in the
+ configuration dictionary. If None given, the object name is used by
+ default.
+ :type name: str
+
.. note:: the registration order will be used when restoring configurations
@@ -299,12 +311,16 @@ class BaseConfigurableClass(object):
In this context a "property" is some named value that can be obtained
via a getter method and can be set via a setter method.
- :param fget: (method or str) method (or name of a method) that gets no
- arguments and returns the value of a property.
- :param fset: (method or str) method (or name of a method) that gets as
- an argument the value of a property, and sets it
- :param name: (str) The name to be used as a key for this property in the configuration
- dictionary
+ :param fget: method (or name of a method) that gets no arguments and
+ returns the value of a property.
+ :type fget: method or str
+ :param fset: method (or name of a method) that gets as an argument the
+ value of a property, and sets it
+ :type fset: method or str
+ :param name: The name to be used as a key for this property in the
+ configuration dictionary
+ :type name: str
+
.. note:: the registration order will be used when restoring configurations
@@ -334,9 +350,13 @@ class BaseConfigurableClass(object):
- `applyConfig` (as provided by, e.g., BaseConfigurableClass)
- `objectName` (as provided by, e.g., QObject)
- :param item: (object) The object that should be registered.
- :param name: (str) The name to be used as a key for this item in the configuration
- dictionary. If None given, the object name is used by default.
+ :param item: The object that should be registered.
+ :type item: object
+ :param name: The name to be used as a key for this item in the
+ configuration dictionary. If None given, the object name is used by
+ default.
+ :type name: str
+
.. note:: the registration order will be used when restoring configurations
@@ -363,12 +383,14 @@ class BaseConfigurableClass(object):
configurable items record. It raises an exception if the item is not
registered
- :param item: (object or str) The object that should be unregistered.
- Alternatively, the name under which the object was registered
- can be passed as a python string.
- :param raiseOnError: (bool) If True (default), it raises a KeyError
- exception if item was not registered. If False, it
- just logs a debug message
+ :param item: The object that should be unregistered. Alternatively, the
+ name under which the object was registered can be passed as a
+ python string.
+ :type item: object or str
+ :param raiseOnError: If True (default), it raises a KeyError exception
+ if item was not registered. If False, it just logs a debug message
+ :type raiseOnError: bool
+
.. seealso:: :meth:`registerConfigProperty`, :meth:`registerConfigDelegate`
"""
@@ -397,15 +419,19 @@ class BaseConfigurableClass(object):
BaseConfigurableClass objects have ["__UNVERSIONED__"] as their list of supported
versions, so unversioned config dicts will be accepted.
- :param configdict: (dict) configuration dictionary to check
- :param showDialog: (bool) whether to show a QtWarning dialog if check
- failed (false by default)
- :param supportedVersions: (sequence<str>, or None) supported version
- numbers, if None given, the versions supported
- by this widget will be used (i.e., those
- defined in self._supportedConfigVersions)
+ :param configdict: configuration dictionary to check
+ :type configdict: dict
+ :param showDialog: whether to show a QtWarning dialog if check failed
+ (false by default)
+ :type showDialog: bool
+ :param supportedVersions: supported version numbers, if None given, the
+ versions supported by this widget will be used (i.e., those defined
+ in self._supportedConfigVersions)
+ :type supportedVersions: sequence<str>, or None
- :return: (bool) returns True if the configdict is of the right version
+
+ :return: returns True if the configdict is of the right version
+ :rtype: bool
"""
if supportedVersions is None:
supportedVersions = self._supportedConfigVersions
@@ -430,8 +456,10 @@ class BaseConfigurableClass(object):
returns the current configuration status encoded as a QByteArray. This
state can therefore be easily stored using QSettings
- :return: (QByteArray) (in the current implementation this is just a
- pickled configdict encoded as a QByteArray
+ :return: (in the current implementation this is just a pickled
+ configdict encoded as a QByteArray
+ :rtype: QByteArray
+
.. seealso:: :meth:`restoreQConfig`
"""
@@ -445,7 +473,9 @@ class BaseConfigurableClass(object):
"""
restores the configuration from a qstate generated by :meth:`getQState`.
- :param qstate: (QByteArray)
+ :param qstate:
+ :type qstate: QByteArray
+
.. seealso:: :meth:`createQConfig`
"""
@@ -459,9 +489,12 @@ class BaseConfigurableClass(object):
def saveConfigFile(self, ofile=None):
"""Stores the current configuration on a file
- :param ofile: (file or string) file or filename to store the configuration
+ :param ofile: file or filename to store the configuration
+ :type ofile: file or string
+
- :return: (str) file name used
+ :return: file name used
+ :rtype: str
"""
import pickle
@@ -490,9 +523,12 @@ class BaseConfigurableClass(object):
def loadConfigFile(self, ifile=None):
"""Reads a file stored by :meth:`saveConfig` and applies the settings
- :param ifile: (file or string) file or filename from where to read the configuration
+ :param ifile: file or filename from where to read the configuration
+ :type ifile: file or string
+
- :return: (str) file name used
+ :return: file name used
+ :rtype: str
"""
import pickle
diff --git a/lib/taurus/qt/qtcore/mimetypes/__init__.py b/lib/taurus/qt/qtcore/mimetypes/__init__.py
index 0e219bc1..38ffb66c 100644
--- a/lib/taurus/qt/qtcore/mimetypes/__init__.py
+++ b/lib/taurus/qt/qtcore/mimetypes/__init__.py
@@ -23,6 +23,7 @@
##
#############################################################################
-"""contains MIME type definitions used by taurus widgets"""
+"""contains MIME type definitions used by taurus widgets
+"""
from .mimetypes import *
diff --git a/lib/taurus/qt/qtcore/mimetypes/mimetypes.py b/lib/taurus/qt/qtcore/mimetypes/mimetypes.py
index e4c98e74..d777f911 100644
--- a/lib/taurus/qt/qtcore/mimetypes/mimetypes.py
+++ b/lib/taurus/qt/qtcore/mimetypes/mimetypes.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""mimetypes.py: contains MIME type definitions used by taurus widgets"""
+"""mimetypes.py: contains MIME type definitions used by taurus widgets
+"""
TAURUS_AUTH_MIME_TYPE = "application/taurus-authority"
TAURUS_DEV_MIME_TYPE = "application/taurus-device"
diff --git a/lib/taurus/qt/qtcore/model/__init__.py b/lib/taurus/qt/qtcore/model/__init__.py
index 139aeeca..006d2eed 100644
--- a/lib/taurus/qt/qtcore/model/__init__.py
+++ b/lib/taurus/qt/qtcore/model/__init__.py
@@ -51,7 +51,6 @@ And now inside a :class:`PyQt.Qt.QComboBox`::
model = taurus.qt.qtcore.TaurusDbPlainDeviceModel()
model.setDataSource(db)
view.setModel(model)
-
"""
from .taurusmodel import *
diff --git a/lib/taurus/qt/qtcore/model/taurusdatabasemodel.py b/lib/taurus/qt/qtcore/model/taurusdatabasemodel.py
index bfcd6979..e2043ea4 100644
--- a/lib/taurus/qt/qtcore/model/taurusdatabasemodel.py
+++ b/lib/taurus/qt/qtcore/model/taurusdatabasemodel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides widgets that display the database in a tree format"""
+"""This module provides widgets that display the database in a tree format
+"""
# TODO: tango-centric
from taurus.external.qt import Qt
@@ -401,7 +402,8 @@ class TaurusTreeDeviceClassItem(TaurusTreeDbBaseItem):
class TaurusDbBaseModel(TaurusBaseModel):
"""The base class for all Taurus database Qt models.
By default, this model represents a plain device perspective of the underlying
- database."""
+ database.
+ """
ColumnNames = "Device", "Alias", "Server", "Class", "Alive", "Host"
ColumnRoles = (
@@ -526,7 +528,8 @@ class TaurusDbBaseModel(TaurusBaseModel):
class TaurusDbSimpleDeviceModel(TaurusDbBaseModel):
"""A Qt model that structures device elements in 1 level tree with
- device name as node leafs. This model contains only 1 column."""
+ device name as node leafs. This model contains only 1 column.
+ """
ColumnNames = ("Device",)
ColumnRoles = ((ElemType.Device, ElemType.Device),)
@@ -534,7 +537,8 @@ class TaurusDbSimpleDeviceModel(TaurusDbBaseModel):
class TaurusDbSimpleDeviceAliasModel(TaurusDbBaseModel):
"""A Qt model that structures device elements in 1 level tree with
- device alias as node leafs. This model contains only 1 column."""
+ device alias as node leafs. This model contains only 1 column.
+ """
ColumnNames = ("Alias",)
ColumnRoles = ((ElemType.DeviceAlias, ElemType.DeviceAlias),)
@@ -559,7 +563,8 @@ class TaurusDbSimpleDeviceAliasModel(TaurusDbBaseModel):
class TaurusDbPlainDeviceModel(TaurusDbBaseModel):
"""A Qt model that structures device elements in 1 level tree. Device
- nodes will have attribute child nodes if the device is running."""
+ nodes will have attribute child nodes if the device is running.
+ """
ColumnNames = "Device", "Alias", "Server", "Class", "Alive", "Host"
ColumnRoles = (
@@ -594,7 +599,8 @@ class TaurusDbDeviceModel(TaurusDbBaseModel):
- <domain>
- <family>
- - <member>"""
+ - <member>
+ """
ColumnRoles = (
(
@@ -679,7 +685,8 @@ class TaurusDbServerModel(TaurusDbBaseModel):
- <Server instance>
- <Class>
- <Device>
- - <Attribute>"""
+ - <Attribute>
+ """
ColumnNames = "Server", "Alive", "Host"
ColumnRoles = (
@@ -749,7 +756,8 @@ class TaurusDbDeviceClassModel(TaurusDbBaseModel):
* <Class>
* <Device>
- * <Attribute>"""
+ * <Attribute>
+ """
ColumnNames = "Class", "Alive", "Host"
ColumnRoles = (
@@ -795,7 +803,8 @@ class TaurusDbDeviceProxyModel(TaurusDbBaseProxyModel):
- TaurusDbBaseModel
- TaurusDbDeviceModel
- TaurusDbSimpleDeviceModel
- - TaurusDbPlainDeviceModel"""
+ - TaurusDbPlainDeviceModel
+ """
def filterAcceptsRow(self, sourceRow, sourceParent):
sourceModel = self.sourceModel()
diff --git a/lib/taurus/qt/qtcore/model/taurusmodel.py b/lib/taurus/qt/qtcore/model/taurusmodel.py
index e68d88c2..80657f92 100644
--- a/lib/taurus/qt/qtcore/model/taurusmodel.py
+++ b/lib/taurus/qt/qtcore/model/taurusmodel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides base taurus tree item and a base tree model"""
+"""This module provides base taurus tree item and a base tree model
+"""
from taurus.external.qt import Qt
from taurus.core.taurusbasetypes import TaurusElementType
@@ -51,34 +52,40 @@ class TaurusBaseTreeItem(object):
def itemData(self):
"""The internal itemData object
- :return: (object) object holding the data of this item
+ :return: object holding the data of this item
+ :rtype: object
"""
return self._itemData
def depth(self):
"""Depth of the node in the hierarchy
- :return: (int) the node depth
+ :return: the node depth
+ :rtype: int
"""
return self._depth
def appendChild(self, child):
"""Adds a new child node
- :param child: (TaurusTreeBaseItem) child to be added
+ :param child: child to be added
+ :type child: TaurusTreeBaseItem
"""
self._childItems.append(child)
def child(self, row):
"""Returns the child in the given row
- :return: (TaurusTreeBaseItem) the child node for the given row"""
+ :return: the child node for the given row
+ :rtype: TaurusTreeBaseItem
+ """
return self._childItems[row]
def childCount(self):
"""Returns the number of childs for this node
- :return: (int) number of childs for this node
+ :return: number of childs for this node
+ :rtype: int
"""
return len(self._childItems)
@@ -88,7 +95,8 @@ class TaurusBaseTreeItem(object):
def data(self, index):
"""Returns the data of this node for the given index
- :return: (object) the data for the given index
+ :return: the data for the given index
+ :rtype: object
"""
return self._itemData[index.column()]
@@ -101,21 +109,24 @@ class TaurusBaseTreeItem(object):
def setData(self, index, data):
"""Sets the node data
- :param data: (object) the data to be associated with this node
+ :param data: the data to be associated with this node
+ :type data: object
"""
self._itemData = data
def parent(self):
"""Returns the parent node or None if no parent exists
- :return: (TaurusTreeBaseItem) the parent node
+ :return: the parent node
+ :rtype: TaurusTreeBaseItem
"""
return self._parentItem
def row(self):
"""Returns the row for this node
- :return: (int) row number for this node
+ :return: row number for this node
+ :rtype: int
"""
if self._parentItem is None:
return 0
@@ -132,7 +143,9 @@ class TaurusBaseTreeItem(object):
def display(self):
"""Returns the display string for this node
- :return: (str) the node's display string"""
+ :return: the node's display string
+ :rtype: str
+ """
if not hasattr(self, "_display"):
if self._itemData is None:
return None
@@ -153,7 +166,9 @@ class TaurusBaseTreeItem(object):
This method should be able to return any kind of python object as long
as the model that is used is compatible.
- :return: (taurus.core.taurusbasetypes.TaurusElementType) the role in form of element type"""
+ :return: the role in form of element type
+ :rtype: taurus.core.taurusbasetypes.TaurusElementType
+ """
return TaurusElementType.Unknown
def __str__(self):
diff --git a/lib/taurus/qt/qtcore/tango/__init__.py b/lib/taurus/qt/qtcore/tango/__init__.py
index 8bb99f80..eb1daad1 100644
--- a/lib/taurus/qt/qtcore/tango/__init__.py
+++ b/lib/taurus/qt/qtcore/tango/__init__.py
@@ -23,6 +23,7 @@
##
#############################################################################
-""""""
+"""
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtcore/taurusqlistener.py b/lib/taurus/qt/qtcore/taurusqlistener.py
index 55bb649f..f5654588 100644
--- a/lib/taurus/qt/qtcore/taurusqlistener.py
+++ b/lib/taurus/qt/qtcore/taurusqlistener.py
@@ -23,7 +23,8 @@
##
#############################################################################
-""""""
+"""
+"""
__all__ = ["QTaurusBaseListener", "QObjectTaurusListener"]
@@ -74,9 +75,12 @@ class QTaurusBaseListener(TaurusListener):
When writing widgets, one should normally work on the Qt thread
(i.e. reimplementing :meth:`handleEvent`)
- :param evt_src: (object) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType) type of event
- :param evt_value: (object) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType
+ :param evt_value: event value
+ :type evt_value: object
"""
self.fireEvent(evt_src, evt_type, evt_value)
@@ -87,9 +91,12 @@ class QTaurusBaseListener(TaurusListener):
instead depending on whether you need to execute code in the python
or Qt threads, respectively
- :param evt_src: (object or None) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType or None) type of event
- :param evt_value: (object or None) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object or None
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType or None
+ :param evt_value: event value
+ :type evt_value: object or None
"""
try:
self.taurusEvent.emit(evt_src, evt_type, evt_value)
@@ -100,9 +107,12 @@ class QTaurusBaseListener(TaurusListener):
"""The event is processed by each and all filters in strict order
unless one of them returns None (in which case the event is discarded)
- :param evt_src: (object) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType) type of event
- :param evt_value: (object) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType
+ :param evt_value: event value
+ :type evt_value: object
"""
r = evt_src, evt_type, evt_value
@@ -126,9 +136,12 @@ class QTaurusBaseListener(TaurusListener):
"""Event handling. Default implementation does nothing.
Reimplement as necessary
- :param evt_src: (object or None) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType or None) type of event
- :param evt_value: (object or None) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object or None
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType or None
+ :param evt_value: event value
+ :type evt_value: object or None
"""
pass
@@ -142,7 +155,9 @@ class QTaurusBaseListener(TaurusListener):
For a library of common filters, see taurus/core/util/eventfilters.py
- :param filters: (sequence) a sequence of filters
+ :param filters: a sequence of filters
+ :type filters: sequence
+
See also: insertEventFilter
"""
@@ -153,15 +168,20 @@ class QTaurusBaseListener(TaurusListener):
def getEventFilters(self):
"""Returns the list of event filters for this widget
- :return: (sequence<callable>) the event filters
+ :return: the event filters
+ :rtype: sequence<callable>
"""
return self._eventFilters
def insertEventFilter(self, filter, index=-1):
"""insert a filter in a given position
- :param filter: (callable(evt_src, evt_type, evt_value)) a filter
- :param index: (int) index to place the filter (default = -1 meaning place at the end)
+ :param filter: ) a filter
+ :type filter: callable(evt_src, evt_type, evt_value
+ :param index: index to place the filter (default = -1 meaning place at
+ the end)
+ :type index: int
+
See also: setEventFilters
"""
diff --git a/lib/taurus/qt/qtcore/util/__init__.py b/lib/taurus/qt/qtcore/util/__init__.py
index af0cfd38..5d23a5f3 100644
--- a/lib/taurus/qt/qtcore/util/__init__.py
+++ b/lib/taurus/qt/qtcore/util/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package provides a set of utilities (e.g. logging) to taurus qtcore"""
+"""This package provides a set of utilities (e.g. logging) to taurus qtcore
+"""
from .tauruslog import *
from .signal import baseSignal
diff --git a/lib/taurus/qt/qtcore/util/emitter.py b/lib/taurus/qt/qtcore/util/emitter.py
index 36746485..fd327e26 100644
--- a/lib/taurus/qt/qtcore/util/emitter.py
+++ b/lib/taurus/qt/qtcore/util/emitter.py
@@ -97,11 +97,12 @@ class TaurusEmitterThread(Qt.QThread):
:param parent: a Qt/Taurus object
:param name: identifies object logs
- :param queue: if None parent.getQueue() is used, if not then the queue
+ :param queue: if None parent.getQueue() is used, if not then the queue
passed as argument is used
:param method: the method to be executed using each queue item as argument
- :param cursor: if True or QCursor a custom cursor is set while
- the Queue is not empty
+ :param cursor: if True or QCursor a custom cursor is set while the Queue is
+ not empty
+
How TaurusEmitterThread works:
@@ -170,7 +171,6 @@ class TaurusEmitterThread(Qt.QThread):
elif self.modelsQueue.qsize():
self.modelsThread.next()
...
-
"""
def __init__(
@@ -447,8 +447,8 @@ class SingletonWorker(object):
:param queue: if None parent.getQueue() is used, if not then the queue
passed as argument is used
:param method: the method to be executed using each queue item as argument
- :param cursor: if True or QCursor a custom cursor is set while
- the Queue is not empty
+ :param cursor: if True or QCursor a custom cursor is set while the Queue is
+ not empty
"""
_thread = None
diff --git a/lib/taurus/qt/qtcore/util/properties.py b/lib/taurus/qt/qtcore/util/properties.py
index 16a751ae..9c60af7d 100644
--- a/lib/taurus/qt/qtcore/util/properties.py
+++ b/lib/taurus/qt/qtcore/util/properties.py
@@ -52,7 +52,6 @@ Not tested yet with the classical declaration:
#model = QtCore.pyqtProperty("QString", TaurusBaseWidget.getModel,
#TaurusBaseWidget.setModel,
#TaurusBaseWidget.resetModel)
-
"""
from taurus.external.qt import Qt
diff --git a/lib/taurus/qt/qtcore/util/signal.py b/lib/taurus/qt/qtcore/util/signal.py
index e93ab292..607ea550 100644
--- a/lib/taurus/qt/qtcore/util/signal.py
+++ b/lib/taurus/qt/qtcore/util/signal.py
@@ -22,7 +22,8 @@
#############################################################################
-"""Provide a Signal class for non-QObject objects"""
+"""Provide a Signal class for non-QObject objects
+"""
from taurus.external.qt import Qt
from threading import Lock
@@ -34,8 +35,8 @@ __all__ = ["baseSignal"]
def baseSignal(name, *args):
"""Signal class for non-Qobject objects.
- :param name: signal name (unlike pyqtSignal, name has
- to be specified explicitely)
+ :param name: signal name (unlike pyqtSignal, name has to be specified
+ explicitely)
:param args: arguments passed to the pyqtSignal
"""
main_lock = Lock()
diff --git a/lib/taurus/qt/qtcore/util/tauruslog.py b/lib/taurus/qt/qtcore/util/tauruslog.py
index a0a836f2..e2ee970e 100644
--- a/lib/taurus/qt/qtcore/util/tauruslog.py
+++ b/lib/taurus/qt/qtcore/util/tauruslog.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module sets the taurus.core.util.log.Logger to be the Qt message handler"""
+"""This module sets the taurus.core.util.log.Logger to be the Qt message handler
+"""
__all__ = ["getQtLogger", "initTaurusQtLogger"]
diff --git a/lib/taurus/qt/qtdesigner/__init__.py b/lib/taurus/qt/qtdesigner/__init__.py
index 749bf1ba..8598334d 100644
--- a/lib/taurus/qt/qtdesigner/__init__.py
+++ b/lib/taurus/qt/qtdesigner/__init__.py
@@ -23,6 +23,7 @@
##
#############################################################################
-"""The taurus.qt.qtdesigner submodule. It contains qt-specific part of taurus"""
+"""The taurus.qt.qtdesigner submodule. It contains qt-specific part of taurus
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtdesigner/taurusplugin/__init__.py b/lib/taurus/qt/qtdesigner/taurusplugin/__init__.py
index 6164789c..9f49b0b6 100644
--- a/lib/taurus/qt/qtdesigner/taurusplugin/__init__.py
+++ b/lib/taurus/qt/qtdesigner/taurusplugin/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""The taurus.qt.qtdesigner.taurusplugin submodule."""
+"""The taurus.qt.qtdesigner.taurusplugin submodule.
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtdesigner/taurusplugin/taurusplugin.py b/lib/taurus/qt/qtdesigner/taurusplugin/taurusplugin.py
index 37b1eeba..02a979e1 100644
--- a/lib/taurus/qt/qtdesigner/taurusplugin/taurusplugin.py
+++ b/lib/taurus/qt/qtdesigner/taurusplugin/taurusplugin.py
@@ -63,7 +63,8 @@ class TaurusWidgetPlugin(QtDesigner.QPyDesignerCustomWidgetPlugin):
def initialize(self, formEditor):
"""Overwrite if necessary. Don't forget to call this method in case you
- want the generic taurus extensions in your widget."""
+ want the generic taurus extensions in your widget.
+ """
if self.isInitialized():
return
@@ -131,7 +132,8 @@ class TaurusWidgetPlugin(QtDesigner.QPyDesignerCustomWidgetPlugin):
def group(self):
"""Returns the name of the group in Qt Designer's widget box that this
widget belongs to.
- It returns 'Taurus Widgets'. Overwrite if want another group."""
+ It returns 'Taurus Widgets'. Overwrite if want another group.
+ """
return self.getWidgetInfo("group", "Taurus Widgets")
def getIconName(self):
@@ -155,7 +157,8 @@ class TaurusWidgetPlugin(QtDesigner.QPyDesignerCustomWidgetPlugin):
def includeFile(self):
"""Returns the module containing the custom widget class. It may include
- a module path."""
+ a module path.
+ """
return self.getWidgetInfo("module")
def toolTip(self):
diff --git a/lib/taurus/qt/qtgui/__init__.py b/lib/taurus/qt/qtgui/__init__.py
index eb7b108b..205a12c9 100644
--- a/lib/taurus/qt/qtgui/__init__.py
+++ b/lib/taurus/qt/qtgui/__init__.py
@@ -26,7 +26,8 @@
"""This package contains a collection of Qt based widgets designed to interact with
taurus models. The widgets are generic in the sence that they do not assume any
behavior associated with a specific HW device. They intend to represent only
-abstract model data."""
+abstract model data.
+"""
# register icon path files and icon theme on import of taurus.qt.qtgui
from . import icon as __icon
diff --git a/lib/taurus/qt/qtgui/application/__init__.py b/lib/taurus/qt/qtgui/application/__init__.py
index 74eb2b98..8263c717 100644
--- a/lib/taurus/qt/qtgui/application/__init__.py
+++ b/lib/taurus/qt/qtgui/application/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides the base :class:`taurus.qt.qtgui.application.TaurusApplication`
-class."""
+class.
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/application/taurusapplication.py b/lib/taurus/qt/qtgui/application/taurusapplication.py
index 905c9b37..26d2b6c3 100644
--- a/lib/taurus/qt/qtgui/application/taurusapplication.py
+++ b/lib/taurus/qt/qtgui/application/taurusapplication.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides the base
-:class:`taurus.qt.qtgui.application.TaurusApplication` class."""
+:class:`taurus.qt.qtgui.application.TaurusApplication` class.
+"""
import os
import sys
@@ -51,15 +52,17 @@ class STD(Logger):
):
"""The STD Logger constructor
- :param name: (str) the logger name (default is empty string)
- :param parent: (Logger) the parent logger or None if no parent exists
- (default is None)
- :param format: (str) the log message format or None to use the default
- log format (default is None)
+ :param name: the logger name (default is empty string)
+ :type name: str
+ :param parent: the parent logger or None if no parent exists (default
+ is None)
+ :type parent: Logger
+ :param format: the log message format or None to use the default log
+ format (default is None)
+ :type format: str
:param std: std to forward write
:param pure_text: if True, writes the 'message' parameter of the log
- message in a separate line preserving the
- indentation
+ message in a separate line preserving the indentation
"""
Logger.__init__(self, name=name, parent=parent, format=format)
self.buffer = ""
@@ -76,7 +79,8 @@ class STD(Logger):
to parent loggers (basically will act as an independent logging system
by itself)
- :param handler: new handler"""
+ :param handler: new handler
+ """
Logger.addLogHandler(self, handler)
self.log_obj.propagate = not len(self.log_handlers)
@@ -154,7 +158,6 @@ class TaurusApplication(Qt.QApplication, Logger):
w.show()
sys.exit(app.exec_())
-
"""
def __init__(self, *args, **kwargs):
@@ -300,7 +303,8 @@ class TaurusApplication(Qt.QApplication, Logger):
command line parameters.
:return: the parser used in the command line
- :rtype: :class:`optparse.OptionParser`"""
+ :rtype: :class:`optparse.OptionParser`
+ """
# TODO: issue a warning if this is uninitialized (cmd_line_parser=None)
return self._cmd_line_parser
@@ -309,7 +313,8 @@ class TaurusApplication(Qt.QApplication, Logger):
command line parameters.
:return: the command line options
- :rtype: :class:`optparse.Option`"""
+ :rtype: :class:`optparse.Option`
+ """
# TODO: issue a warning if this is uninitialized (cmd_line_parser=None)
return self._cmd_line_options
@@ -318,7 +323,8 @@ class TaurusApplication(Qt.QApplication, Logger):
command line parameters.
:return: the command line arguments
- :rtype: list of strings"""
+ :rtype: list of strings
+ """
# TODO: issue a warning if this is uninitialized (cmd_line_parser=None)
return self._cmd_line_args
@@ -326,7 +332,8 @@ class TaurusApplication(Qt.QApplication, Logger):
"""Sets taurus application style to the given style name
:param styleName: the new style name to be applied
- :type styleName: str"""
+ :type styleName: str
+ """
import taurus.qt.qtgui.style
taurus.qt.qtgui.style.setTaurusStyle(styleName)
diff --git a/lib/taurus/qt/qtgui/base/__init__.py b/lib/taurus/qt/qtgui/base/__init__.py
index 89a6e91a..b2f41a78 100644
--- a/lib/taurus/qt/qtgui/base/__init__.py
+++ b/lib/taurus/qt/qtgui/base/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""This package provides the set of base classes from which the Qt taurus widgets
-should inherit to be considered valid taurus widgets."""
+should inherit to be considered valid taurus widgets.
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/base/taurusbase.py b/lib/taurus/qt/qtgui/base/taurusbase.py
index 97fef4e3..e06d3e9c 100644
--- a/lib/taurus/qt/qtgui/base/taurusbase.py
+++ b/lib/taurus/qt/qtgui/base/taurusbase.py
@@ -25,7 +25,8 @@
#############################################################################
"""This module provides the set of base classes from which the Qt taurus widgets
-should inherit to be considered valid taurus widgets."""
+should inherit to be considered valid taurus widgets.
+"""
import sys
import threading
@@ -77,11 +78,14 @@ def defaultFormatter(dtype=None, basecomponent=None, **kwargs):
Default formatter callable. Returns a format string based on dtype
and the mapping provided by :attr:`TaurusBaseComponent.defaultFormatDict`
- :param dtype: (object) data type
+ :param dtype: data type
+ :type dtype: object
:param basecomponent: widget whose display is to be formatted
:param kwargs: other keyworld arguments
- :return: (str) The format string corresponding to the given dtype.
+
+ :return: The format string corresponding to the given dtype.
+ :rtype: str
"""
if issubclass(dtype, Enum):
dtype = Enum
@@ -107,7 +111,6 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
:meth:`getSignaller` is now unused and deprecated. This is because
`taurusEvent` is implemented using :func:`baseSignal`, that doesn't
require the class to inherit from QObject.
-
"""
_modifiableByUser = False
@@ -223,7 +226,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def deleteLater(self):
"""Reimplements the Qt.QObject deleteLater method to ensure that the
- this object stops listening its model."""
+ this object stops listening its model.
+ """
self.setUseParentModel(False)
self.resetModel()
Qt.QObject.deleteLater(self)
@@ -239,7 +243,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
import taurus
manager = taurus.Manager()
- :return: (taurus.core.taurusmanager.TaurusManager) the TaurusManager
+ :return: the TaurusManager
+ :rtype: taurus.core.taurusmanager.TaurusManager
"""
return taurus.Manager()
@@ -250,12 +255,15 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
import taurus
factory = taurus.Factory(scheme)
- :param scheme: (str or None) the scheme. If scheme is an empty string,
- or is not passed, the scheme will be obtained from the
- model name. For backwards compatibility (but deprecated),
- passing None is equivalent to 'tango'.
+ :param scheme: the scheme. If scheme is an empty string, or is not
+ passed, the scheme will be obtained from the model name. For
+ backwards compatibility (but deprecated), passing None is
+ equivalent to 'tango'.
+ :type scheme: str or None
- :return: (taurus.core.taurusfactory.TaurusFactory) the TaurusFactory
+
+ :return: the TaurusFactory
+ :rtype: taurus.core.taurusfactory.TaurusFactory
"""
if scheme == "":
scheme = taurus.getSchemeFromName(self.getModelName() or "")
@@ -330,8 +338,9 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
If period is 0, the event buffering is disabled (i.e., events are fired
as soon as they are received)
- :param period: (float) period in seconds for the automatic event firing.
- period=0 will disable the event buffering.
+ :param period: period in seconds for the automatic event firing.
+ period=0 will disable the event buffering.
+ :type period: float
"""
self._eventBufferPeriod = period
if period == 0:
@@ -349,7 +358,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getEventBufferPeriod(self):
"""Returns the event buffer period
- :return: (float) period (in s). 0 means event buffering is disabled.
+ :return: period (in s). 0 means event buffering is disabled.
+ :rtype: float
"""
return self._eventBufferPeriod
@@ -370,9 +380,12 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
When writing widgets, one should normally work on the Qt thread
(i.e. reimplementing :meth:`handleEvent`)
- :param evt_src: (object) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType) type of event
- :param evt_value: (object) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType
+ :param evt_value: event value
+ :type evt_value: object
"""
evt = filterEvent(
evt_src, evt_type, evt_value, filters=self._preFilters
@@ -387,10 +400,12 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
instead depending on whether you need to execute code in the python
or Qt threads, respectively
- :param evt_src: (object or None) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType or None)
- type of event
- :param evt_value: (object or None) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object or None
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType or None
+ :param evt_value: event value
+ :type evt_value: object or None
"""
if self._eventBufferPeriod:
# If we have an active event buffer delay, store the event...
@@ -422,9 +437,12 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""The event is processed by each and all filters in strict order
unless one of them returns None (in which case the event is discarded)
- :param evt_src: (object) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType) type of event
- :param evt_value: (object) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType
+ :param evt_value: event value
+ :type evt_value: object
"""
evt = evt_src, evt_type, evt_value
@@ -446,9 +464,12 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Event handling. Default implementation does nothing.
Reimplement as necessary
- :param evt_src: (object or None) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType or None) type of event
- :param evt_value: (object or None) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object or None
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType or None
+ :param evt_value: event value
+ :type evt_value: object or None
"""
pass
@@ -462,11 +483,13 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
For a library of common filters, see taurus/core/util/eventfilters.py
- :param filters: (sequence) a sequence of filters
- :param preqt: (bool) If true, set the pre-filters (that are applied in
- eventReceived, at the python thread),
- otherwise, set the filters to be applied at the main
- Qt thread (default)
+ :param filters: a sequence of filters
+ :type filters: sequence
+ :param preqt: If true, set the pre-filters (that are applied in
+ eventReceived, at the python thread), otherwise, set the filters to
+ be applied at the main Qt thread (default)
+ :type preqt: bool
+
*Note*: If you are setting a filter that applies a transformation on
the parameters, you may want to generate a fake event to force the last
@@ -488,24 +511,30 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getEventFilters(self, preqt=False):
"""Returns the list of event filters for this widget
- :param preqt: (bool) If true, return the pre-filters (that are applied
- in eventReceived, at the python thread),
- otherwise, return the filters to be applied at the main
- Qt thread (default)
+ :param preqt: If true, return the pre-filters (that are applied in
+ eventReceived, at the python thread), otherwise, return the filters
+ to be applied at the main Qt thread (default)
+ :type preqt: bool
- :return: (sequence<callable>) the event filters
+
+ :return: the event filters
+ :rtype: sequence<callable>
"""
return self._preFilters if preqt else self._eventFilters
def insertEventFilter(self, filter, index=-1, preqt=False):
"""insert a filter in a given position
- :param filter: (callable(evt_src, evt_type, evt_value)) a filter
- :param index: (int) index to place the filter (default = -1 meaning place at the end)
- :param preqt: (bool) If true, set the pre-filters (that are applied in
- eventReceived, at the python thread),
- otherwise, set the filters to be applied at the main
- Qt thread (default)
+ :param filter: ) a filter
+ :type filter: callable(evt_src, evt_type, evt_value
+ :param index: index to place the filter (default = -1 meaning place at
+ the end)
+ :type index: int
+ :param preqt: If true, set the pre-filters (that are applied in
+ eventReceived, at the python thread), otherwise, set the filters to
+ be applied at the main Qt thread (default)
+ :type preqt: bool
+
See also: setEventFilters
@@ -518,7 +547,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def setPaused(self, paused=True):
"""Toggles the pause mode.
- :param paused: (bool) whether or not to pause (default = True)
+ :param paused: whether or not to pause (default = True)
+ :type paused: bool
"""
if paused == self._isPaused:
return # nothing to do
@@ -536,7 +566,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def isPaused(self):
"""Return the current pause state
- :return: (bool) wheater or not the widget is paused
+ :return: wheater or not the widget is paused
+ :rtype: bool
"""
return self._isPaused
@@ -550,8 +581,9 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
type corresponds to the current model name.
Overwrite as necessary.
- :return: (class TaurusModel or None) The class object corresponding to the type
- of Taurus model this widget handles or None if no valid class is found.
+ :return: The class object corresponding to the type of Taurus model
+ this widget handles or None if no valid class is found.
+ :rtype: class TaurusModel or None
"""
return self.findModelClass()
@@ -559,8 +591,9 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Do a "best effort" to determine which model type corresponds to the
given model name.
- :return: (class TaurusModel or None) The class object corresponding to the type
- of Taurus model this widget handles or None if no valid class is found.
+ :return: The class object corresponding to the type of Taurus model
+ this widget handles or None if no valid class is found.
+ :rtype: class TaurusModel or None
"""
if self.getUseParentModel():
return self._findRelativeModelClass(self.getModel())
@@ -599,9 +632,12 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
will set the new model to the given modelName and it will attach
this component to the new taurus model.
- :param modelName: (str) the new taurus model name (according to the taurus convention)
- :param parent: (TaurusBaseComponent) the parent or None (default) if this
- component does not have a parent Taurus component
+ :param modelName: the new taurus model name (according to the taurus
+ convention)
+ :type modelName: str
+ :param parent: the parent or None (default) if this component does not
+ have a parent Taurus component
+ :type parent: TaurusBaseComponent
"""
modelName = str(modelName)
if parent:
@@ -624,14 +660,16 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getModelName(self):
"""Returns the current model name.
- :return: (str) the model name
+ :return: the model name
+ :rtype: str
"""
return self.modelName
def getFullModelName(self):
"""Returns the full name of the current model object.
- :return: (str) the model name
+ :return: the model name
+ :rtype: str
"""
obj = self.getModelObj()
if obj is None:
@@ -642,7 +680,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Returns the parent model name or an empty string if the component
has no parent
- :return: (str) the parent model name
+ :return: the parent model name
+ :rtype: str
"""
try:
p = self.getParentTaurusComponent()
@@ -656,7 +695,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Returns the parent model object or None if the component has no
parent or if the parent's model is None
- :return: (taurus.core.taurusmodel.TaurusModel or None) the parent taurus model object
+ :return: the parent taurus model object
+ :rtype: taurus.core.taurusmodel.TaurusModel or None
"""
try:
p = self.getParentTaurusComponent()
@@ -670,7 +710,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Returns the taurus model obj associated with this component or None if
no taurus model is associated.
- :return: (taurus.core.taurusmodel.TaurusModel or None) the taurus model object
+ :return: the taurus model object
+ :rtype: taurus.core.taurusmodel.TaurusModel or None
"""
return self.modelObj
@@ -678,7 +719,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Returns the taurus model type associated with this component or
taurus.core.taurusbasetypes.TaurusElementType.Unknown if no taurus model is associated.
- :return: (taurus.core.taurusbasetypes.TaurusElementType) the taurus model type
+ :return: the taurus model type
+ :rtype: taurus.core.taurusbasetypes.TaurusElementType
"""
model_obj = self.getModelObj()
if model_obj is None:
@@ -689,10 +731,13 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Returns the tango obj value associated with this component or None
if no taurus model is associated.
- :param cache: (bool) if set to True (default) use the cache value. If set to
- False will force a connection to the server.
+ :param cache: if set to True (default) use the cache value. If set to
+ False will force a connection to the server.
+ :type cache: bool
+
- :return: (TaurusAttrValue) the tango value object.
+ :return: the tango value object.
+ :rtype: TaurusAttrValue
"""
if self.modelObj is None:
return None
@@ -712,13 +757,15 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
raised (other exceptions may be raised when accessing the fragment as
well)
- :param fragmentName: (str or None) the returned value will correspond to
- the given fragmentName. If None passed,
- self.modelFragmentName will be used, and if None is
- set, the defaultFragmentName of the model will be used
- instead.
+ :param fragmentName: the returned value will correspond to the given
+ fragmentName. If None passed, self.modelFragmentName will be used,
+ and if None is set, the defaultFragmentName of the model will be
+ used instead.
+ :type fragmentName: str or None
- :return: (obj) the member of the modelObj referred by the fragment.
+
+ :return: the member of the modelObj referred by the fragment.
+ :rtype: obj
"""
if fragmentName is None: # no fragmentName passed in kwargs
fragmentName = self.modelFragmentName
@@ -737,10 +784,13 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getFormatedToolTip(self, cache=True):
"""Returns a string with contents to be displayed in a tooltip.
- :param cache: (bool) if set to True (default) use the cache value. If set to
- False will force a connection to the server.
+ :param cache: if set to True (default) use the cache value. If set to
+ False will force a connection to the server.
+ :type cache: bool
+
- :return: (str) a tooltip
+ :return: a tooltip
+ :rtype: str
"""
if self.modelObj is None:
return self.getNoneValue()
@@ -750,9 +800,12 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def toolTipObjToStr(self, toolTipObj):
"""Converts a python dict to a tooltip string.
- :param toolTipObj: (dict) a python object
+ :param toolTipObj: a python object
+ :type toolTipObj: dict
- :return: (str) a tooltip
+
+ :return: a tooltip
+ :rtype: str
"""
if toolTipObj is None:
return self.getNoneValue()
@@ -820,9 +873,12 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
[1] https://docs.python.org/2/library/string.html
- :param v: (object) the value to be translated to string
+ :param v: the value to be translated to string
+ :type v: object
+
- :return: (str) a string representing the given value
+ :return: a string representing the given value
+ :rtype: str
"""
if self._format is None:
try:
@@ -853,9 +909,10 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
which can be a string or a callable that returns a string
(see :meth:`displayValue`).
- :param dtype: (object) data type
+ :param dtype: data type
+ :type dtype: object
:param kwargs: keyword arguments that will be passed to
- :attribute:`FORMAT` if it is a callable
+ :attribute:`FORMAT` if it is a callable
"""
if self.FORMAT is None or isinstance(self.FORMAT, str):
self._format = self.FORMAT
@@ -872,9 +929,9 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
It also resets the internal format string, which will be recalculated
in the next call to :meth:`displayValue`
- :param format: (str or callable) A format string
- or a formatter callable (or the callable name in
- "full.module.callable" format)
+ :param format: A format string or a formatter callable (or the callable
+ name in "full.module.callable" format)
+ :type format: str or callable
"""
# Check if the format is a callable string representation
if isinstance(format, str):
@@ -891,8 +948,9 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getFormat(self):
"""Method to get the `FORMAT` attribute for this instance.
- :return: (str) a string of the current format. It could be a python
- format string or a callable string representation.
+ :return: a string of the current format. It could be a python format
+ string or a callable string representation.
+ :rtype: str
"""
if isinstance(self.FORMAT, str):
formatter = self.FORMAT
@@ -912,14 +970,17 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Returns a string representation of the model value associated with
this component.
- :param cache: (bool) (ignored, just for bck-compat).
- :param fragmentName: (str or None) the returned value will correspond to
- the given fragmentName. If None passed,
- self.modelFragmentName will be used, and if None is
- set, the defaultFragmentName of the model will be used
- instead.
+ :param cache: (ignored, just for bck-compat).
+ :type cache: bool
+ :param fragmentName: the returned value will correspond to the given
+ fragmentName. If None passed, self.modelFragmentName will be used,
+ and if None is set, the defaultFragmentName of the model will be
+ used instead.
+ :type fragmentName: str or None
+
- :return: (str) a string representation of the model value.
+ :return: a string representation of the model value.
+ :rtype: str
"""
if self.modelObj is None:
return self.getNoneValue()
@@ -941,14 +1002,16 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def setNoneValue(self, v):
"""Sets the new string representation when no model or no model value exists.
- :param v: (str) the string representation for an invalid value
+ :param v: the string representation for an invalid value
+ :type v: str
"""
self.noneValue = v
def getNoneValue(self):
"""Returns the current string representation when no valid model or model value exists.
- :return: (str) a string representation for an invalid value
+ :return: a string representation for an invalid value
+ :rtype: str
"""
return self.noneValue
@@ -960,7 +1023,9 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
- the taurus model is writable and
- this component is not read-only
- :return: (bool) True if this component value can be changed by the user or False otherwise
+ :return: True if this component value can be changed by the user or
+ False otherwise
+ :rtype: bool
"""
res = False
if not self.modelObj is None:
@@ -974,14 +1039,16 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
Override when necessary.
- :return: (bool) whether or not this component is read-only
+ :return: whether or not this component is read-only
+ :rtype: bool
"""
return True
def isAttached(self):
"""Determines if this component is attached to the taurus model.
- :return: (bool) True if the component is attached or False otherwise.
+ :return: True if the component is attached or False otherwise.
+ :rtype: bool
"""
return self._attached
@@ -1022,7 +1089,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
In general it should not be necessary to overwrite this method in a
subclass.
- :return: (bool) True if success in attachment or False otherwise.
+ :return: True if success in attachment or False otherwise.
+ :rtype: bool
"""
if self.isAttached():
return self._attached
@@ -1085,13 +1153,13 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
- "model"
- :param yesno: (bool) If True, the model-related properties will be
- registered as config properties. If False, they will be
- unregistered.
+ :param yesno: If True, the model-related properties will be registered
+ as config properties. If False, they will be unregistered.
+ :type yesno: bool
+
.. seealso:: :meth:`registerConfigProperty`, :meth:`createConfig`,
:meth:`applyConfig`
-
"""
if yesno == self._modelInConfig:
return
@@ -1116,8 +1184,10 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
Use :meth:`TaurusBaseWidget.safeApplyOperation` if you want to warn the
user before applying
- :param ops: (sequence<taurus.core.taurusoperation.TaurusOperation> or None) list of operations to apply.
- If None is given (default) the component fetches the pending operations
+ :param ops: list of operations to apply. If None is given (default) the
+ component fetches the pending operations
+ :type ops: sequence<taurus.core.taurusoperation.TaurusOperation> or
+ None
"""
self.debug("Apply changes")
if ops is None:
@@ -1137,14 +1207,16 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def hasPendingOperations(self):
"""Returns if the component has pending operations
- :return: (bool) True if there are pending operations or False otherwise
+ :return: True if there are pending operations or False otherwise
+ :rtype: bool
"""
return len(self.getPendingOperations()) > 0
def getPendingOperations(self):
"""Returns the sequence of pending operations
- :return: (sequence<taurus.core.taurusoperation.TaurusOperation>) a list of pending operations
+ :return: a list of pending operations
+ :rtype: sequence<taurus.core.taurusoperation.TaurusOperation>
"""
return self._operations
@@ -1156,8 +1228,9 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
"""Sets the danger message when applying an operation. If dangerMessage is None,
the apply operation is considered safe
- :param dangerMessage: (str or None) the danger message. If None is given (default)
- the apply operation is considered safe
+ :param dangerMessage: the danger message. If None is given (default)
+ the apply operation is considered safe
+ :type dangerMessage: str or None
"""
self._dangerMessage = dangerMessage
self._isDangerous = len(dangerMessage) > 0
@@ -1165,32 +1238,39 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getDangerMessage(self):
"""Returns the current apply danger message or None if the apply operation is safe
- :return: (str or None) the apply danger message
+ :return: the apply danger message
+ :rtype: str or None
"""
return self._dangerMessage
def resetDangerMessage(self):
"""Clears the danger message. After this method is executed the apply operation
- for this component will be considered safe."""
+ for this component will be considered safe.
+ """
self.setDangerMessage(None)
def isDangerous(self):
"""Returns if the apply operation for this component is dangerous
- :return: (bool) wheter or not the apply operation for this component is dangerous
+ :return: wheter or not the apply operation for this component is
+ dangerous
+ :rtype: bool
"""
return self._isDangerous
def setForceDangerousOperations(self, yesno):
"""Forces/clears the dangerous operations
- :param yesno: (bool) force or not the dangerous operations"""
+ :param yesno: force or not the dangerous operations
+ :type yesno: bool
+ """
self._forceDangerousOperations = yesno
def getForceDangerousOperations(self):
"""Returns if apply dangerous operations is forced
- :return: (bool) wheter or not apply dangerous operations is forced
+ :return: wheter or not apply dangerous operations is forced
+ :rtype: bool
"""
return self._forceDangerousOperations
@@ -1205,14 +1285,17 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getModel(self):
"""Returns the model name for this component.
- :return: (str) the model name.
+ :return: the model name.
+ :rtype: str
"""
return self._localModelName
def setModel(self, model):
"""Sets/unsets the model name for this component
- :param model: (str) the new model name"""
+ :param model: the new model name
+ :type model: str
+ """
self.setModelCheck(model)
self.resetFormat()
self.updateStyle()
@@ -1223,8 +1306,11 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
If so then nothing is done. This should be the standard way to call this
method since it will avoid recursion.
- :param model: (str) the new model name
- :param check: (bool) whether or not to check against the actual model name"""
+ :param model: the new model name
+ :type model: str
+ :param check: whether or not to check against the actual model name
+ :type check: bool
+ """
if model is None:
model = ""
model = str(model)
@@ -1256,7 +1342,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getUseParentModel(self):
"""Returns whether this component is using the parent model
- :return: (bool) True if using parent model or False otherwise
+ :return: True if using parent model or False otherwise
+ :rtype: bool
"""
return getattr(self, "_useParentModel", False)
@@ -1264,7 +1351,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def setUseParentModel(self, yesno):
"""Sets/unsets using the parent model
- :param yesno: (bool) whether or not to use parent model
+ :param yesno: whether or not to use parent model
+ :type yesno: bool
"""
if yesno:
self.deprecated(
@@ -1287,7 +1375,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def setShowQuality(self, showQuality):
"""Sets/unsets the show quality property
- :param showQuality: (bool) whether or not to show the quality
+ :param showQuality: whether or not to show the quality
+ :type showQuality: bool
"""
if showQuality == self._showQuality:
return
@@ -1297,7 +1386,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getShowQuality(self):
"""Returns if showing the quality as a background color
- :return: (bool) True if showing the quality or False otherwise
+ :return: True if showing the quality or False otherwise
+ :rtype: bool
"""
return self._showQuality
@@ -1309,7 +1399,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def setShowText(self, showText):
"""Sets/unsets showing the display value of the model
- :param showText: (bool) whether or not to show the display value
+ :param showText: whether or not to show the display value
+ :type showText: bool
"""
if showText == self._showText:
return
@@ -1322,7 +1413,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getShowText(self):
"""Returns if showing the display value
- :return: (bool) True if showing the display value or False otherwise
+ :return: True if showing the display value or False otherwise
+ :rtype: bool
"""
return self._showText
@@ -1334,7 +1426,9 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def setTaurusPopupMenu(self, menuData):
"""Sets/unsets the taurus popup menu
- :param menuData: (str) an xml representing the popup menu"""
+ :param menuData: an xml representing the popup menu
+ :type menuData: str
+ """
self.taurusMenuData = str(menuData)
self.__explicitPopupMenu = True
factory = ActionFactory()
@@ -1344,7 +1438,8 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def getTaurusPopupMenu(self):
"""Returns an xml string representing the current taurus popup menu
- :return: (str) an xml string representing the current taurus popup menu
+ :return: an xml string representing the current taurus popup menu
+ :rtype: str
"""
return self.taurusMenuData
@@ -1357,14 +1452,17 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def isModifiableByUser(self):
"""whether the user can change the contents of the widget
- :return: (bool) True if the user is allowed to modify the look&feel"""
+ :return: True if the user is allowed to modify the look&feel
+ :rtype: bool
+ """
return self._modifiableByUser
def setModifiableByUser(self, modifiable):
"""
sets whether the user is allowed to modify the look&feel
- :param modifiable: (bool)
+ :param modifiable:
+ :type modifiable: bool
"""
self._modifiableByUser = modifiable
@@ -1379,15 +1477,18 @@ class TaurusBaseComponent(TaurusListener, BaseConfigurableClass):
def isAutoProtectOperation(self):
"""Tells if this widget's operations are protected against exceptions
- :return: (bool) True if operations are protected against exceptions or
- False otherwise"""
+ :return: True if operations are protected against exceptions or False
+ otherwise
+ :rtype: bool
+ """
return self._autoProtectOperation
def setAutoProtectOperation(self, protect):
"""Sets/unsets this widget's operations are protected against exceptions
:param protect: wheater or not to protect widget operations
- :type protect: bool"""
+ :type protect: bool
+ """
self._autoProtectOperation = protect
@@ -1396,7 +1497,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
.. note::
Any class which inherits from TaurusBaseWidget is expected to also
- inherit from QWidget (or from a QWidget derived class)"""
+ inherit from QWidget (or from a QWidget derived class)
+ """
modelChanged = baseSignal("modelChanged", "QString")
valueChangedSignal = baseSignal("valueChanged")
@@ -1415,7 +1517,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
@deprecation_decorator(rel="4.6.2", alt="onSetFormatter")
def showFormatterDlg(self):
"""deprecated because it does not distinguish between a user cancelling
- the dialog and the user selecting `None` as a formatter."""
+ the dialog and the user selecting `None` as a formatter.
+ """
formatter, ok = self.showFormatterDlg()
if not ok:
return None
@@ -1426,8 +1529,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
"""
Shows a dialog to get the formatter from the user.
- :return: formatter: python format string or formatter callable
- (in string version) or None
+ :return: formatter: python format string or formatter callable (in
+ string version) or None
"""
# add formatters from plugins
known_formatters = TaurusBaseWidget.get_registered_formatters()
@@ -1499,10 +1602,13 @@ class TaurusBaseWidget(TaurusBaseComponent):
def getQtClass(self, bases=None):
"""Returns the parent Qt class for this widget
- :param bases: (sequence<class> or None) the list of class objects. If None
- is given (default) it uses the object base classes from __bases__
+ :param bases: the list of class objects. If None is given (default) it
+ uses the object base classes from __bases__
+ :type bases: sequence<class> or None
+
- :return: (QWidget class) the QWidget class object
+ :return: the QWidget class object
+ :rtype: QWidget class
"""
bases = bases or self.__class__.__bases__
for klass in bases:
@@ -1528,7 +1634,9 @@ class TaurusBaseWidget(TaurusBaseComponent):
.. note:: in some cases you may need to call :meth:`recheckTaurusParent`
after reparenting of some of this widget's ancestors
- :param yesno: (bool) whether or not to use parent model
+ :param yesno: whether or not to use parent model
+ :type yesno: bool
+
.. seealso:: :meth:`recheckTaurusParent`
"""
@@ -1580,8 +1688,10 @@ class TaurusBaseWidget(TaurusBaseComponent):
If so then nothing is done. This should be the standard way to call this
method since it will avoid recursion.
- :param model: (str) the new model name
- :param check: (bool) whether or not to check against the actual model name
+ :param model: the new model name
+ :type model: str
+ :param check: whether or not to check against the actual model name
+ :type check: bool
"""
if model is None:
model = ""
@@ -1618,7 +1728,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
def parentModelChanged(self, parentmodel_name):
"""Invoked when the Taurus parent model changes
- :param parentmodel_name: (str) the new name of the parent model
+ :param parentmodel_name: the new name of the parent model
+ :type parentmodel_name: str
"""
self.debug("Parent model changed to '%s'" % parentmodel_name)
parentmodel_name = str(parentmodel_name)
@@ -1637,9 +1748,12 @@ class TaurusBaseWidget(TaurusBaseComponent):
Override when necessary.
- :param evt_src: (object or None) object that triggered the event
- :param evt_type: (taurus.core.taurusbasetypes.TaurusEventType or None) type of event
- :param evt_value: (object or None) event value
+ :param evt_src: object that triggered the event
+ :type evt_src: object or None
+ :param evt_type: type of event
+ :type evt_type: taurus.core.taurusbasetypes.TaurusEventType or None
+ :param evt_value: event value
+ :type evt_value: object or None
"""
# Update the text shown by the widget
if self._setText:
@@ -1705,7 +1819,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
"""Returns the first taurus component in the widget hierarchy or None if no
taurus component is found
- :return: (TaurusBaseComponent or None) the parent taurus base component
+ :return: the parent taurus base component
+ :rtype: TaurusBaseComponent or None
"""
p = self.parentWidget()
while p and not isinstance(p, TaurusBaseWidget):
@@ -1719,7 +1834,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
def setDisconnectOnHide(self, disconnect):
"""Sets/unsets disconnection on hide event
- :param disconnect: (bool) whether or not to disconnect on hide event
+ :param disconnect: whether or not to disconnect on hide event
+ :type disconnect: bool
"""
if not self.visible() and disconnect == False:
self.info(
@@ -1767,7 +1883,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
"""Determine if this widget is able to display the text value of the taurus
model. It searches through the possible Qt methods to display text.
- :return: (callable) a python method or None if no suitable method is found.
+ :return: a python method or None if no suitable method is found.
+ :rtype: callable
"""
setMethod = None
try:
@@ -1793,7 +1910,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
def setModifiableByUser(self, modifiable):
"""Reimplemented to acept/reject drops based on whether the widget is modifiable by the user.
- See :meth:`TaurusBaseComponent.setModifiableByUser()`"""
+ See :meth:`TaurusBaseComponent.setModifiableByUser()`
+ """
TaurusBaseComponent.setModifiableByUser(self, modifiable)
self.setAcceptDrops(modifiable)
@@ -1807,7 +1925,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
This provides only a very basic implementation. Reimplement in derived classes if needed
- :return: (list<str>) list of MIME type names
+ :return: list of MIME type names
+ :rtype: list<str>
"""
if self._supportedMimeTypes is not None:
return self._supportedMimeTypes
@@ -1827,7 +1946,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
"""
sets the mimeTypes that this widget support
- :param mimetypes: (list<str>) list (ordered by priority) of MIME type names
+ :param mimetypes: list (ordered by priority) of MIME type names
+ :type mimetypes: list<str>
"""
self._supportedMimeTypes = mimetypes
@@ -1845,7 +1965,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
The default implementation returns `self.setModel`. Reimplement
it subclasses to call different methods.
- :return: (callable)
+ :return:
+ :rtype: callable
"""
return self.setModel
@@ -1864,13 +1985,17 @@ class TaurusBaseWidget(TaurusBaseComponent):
(in the order returned by :meth:`getSupportedMimeTypes`) and passes
it to the given method.
- :param mimeData: (QMimeData) the MIME data object from which the model
- is to be extracted
- :param method: (callable<str>) a method that accepts a string as argument.
- This method will be called with the data from the mimeData object
+ :param mimeData: the MIME data object from which the model is to be
+ extracted
+ :type mimeData: QMimeData
+ :param method: a method that accepts a string as argument. This method
+ will be called with the data from the mimeData object
+ :type method: callable<str>
- :return: (str or None) returns the MimeType used if the model was
- successfully set, or None if the model could not be set
+
+ :return: returns the MimeType used if the model was successfully set,
+ or None if the model could not be set
+ :rtype: str or None
"""
supported = self.getSupportedMimeTypes()
formats = mimeData.formats()
@@ -1896,7 +2021,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
Attribute or Device, it also fills `TAURUS_ATTR_MIME_TYPE` or
`TAURUS_DEV_MIME_TYPE`, respectively
- :return: (QMimeData)
+ :return:
+ :rtype: QMimeData
"""
mimeData = Qt.QMimeData()
modelname = str(self.getModelName()).encode(encoding="utf8")
@@ -1913,7 +2039,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
def mousePressEvent(self, event):
"""reimplemented to record the start position for drag events.
- See :class:`~PyQt5.Qt.QWidget`"""
+ See :class:`~PyQt5.Qt.QWidget`
+ """
if self._dragEnabled and event.button() == Qt.Qt.LeftButton:
# I need to copy it explicitly to avoid a bug with PyQt4.4
self.dragStartPosition = Qt.QPoint(event.pos())
@@ -1921,7 +2048,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
def mouseMoveEvent(self, event):
"""reimplemented to provide drag events.
- See :class:`~PyQt5.Qt.QWidget`"""
+ See :class:`~PyQt5.Qt.QWidget`
+ """
if not self._dragEnabled or not event.buttons() & Qt.Qt.LeftButton:
return self.getQtClass().mouseMoveEvent(self, event)
if (
@@ -1940,14 +2068,17 @@ class TaurusBaseWidget(TaurusBaseComponent):
def isDragEnabled(self):
"""whether the user can drag data from this widget
- :return: (bool) True if the user can drag data"""
+ :return: True if the user can drag data
+ :rtype: bool
+ """
return self._dragEnabled
def setDragEnabled(self, enabled):
"""
sets whether the user is allowed to drag data from this widget
- :param modifiable: (bool)
+ :param modifiable:
+ :type modifiable: bool
"""
self._dragEnabled = enabled
@@ -1961,23 +2092,29 @@ class TaurusBaseWidget(TaurusBaseComponent):
def updatePendingOpsStyle(self):
"""This method should be reimplemented by derived classes that want to
- change their appearance depending whether there are pending operations or not"""
+ change their appearance depending whether there are pending operations or not
+ """
pass
def emitValueChanged(self, *args):
"""Connect the specific XXXXChanged signals from derived classes to this
- method in order to have a unified signal which can be used by Taurus Widgets"""
+ method in order to have a unified signal which can be used by Taurus Widgets
+ """
self.valueChangedSignal.emit()
self.updatePendingOpsStyle() # by default, update its own style
def safeApplyOperations(self, ops=None):
"""Applies the given operations (or the pending operations if None passed)
- :param ops: (sequence<taurus.core.taurusoperation.TaurusOperation> or None) list of operations to apply.
- If None is given (default) the component fetches the pending operations
+ :param ops: list of operations to apply. If None is given (default) the
+ component fetches the pending operations
+ :type ops: sequence<taurus.core.taurusoperation.TaurusOperation> or
+ None
+
- :return: (bool) False if the apply was aborted by the user or if the
- widget is in design mode. True otherwise.
+ :return: False if the apply was aborted by the user or if the widget is
+ in design mode. True otherwise.
+ :rtype: bool
"""
if ops is None:
@@ -2033,7 +2170,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
"""Determines if the widget should automatically generate a tooltip
based on the current widget model.
- :param yesno: (bool) True to automatically generate tooltip or False otherwise
+ :param yesno: True to automatically generate tooltip or False otherwise
+ :type yesno: bool
"""
self._autoTooltip = yesno
@@ -2041,7 +2179,8 @@ class TaurusBaseWidget(TaurusBaseComponent):
"""Returns if the widget is automatically generating a tooltip based
on the current widget model.
- :return: (bool) True if automatically generating tooltip or False otherwise
+ :return: True if automatically generating tooltip or False otherwise
+ :rtype: bool
"""
return self._autoTooltip
@@ -2063,7 +2202,9 @@ class TaurusBaseWidget(TaurusBaseComponent):
'icon' : 'logos:taurus.png',
'container' : False }
- :return: (dict) a map with pertinent designer information"""
+ :return: a map with pertinent designer information
+ :rtype: dict
+ """
return {
"group": "Taurus [Unclassified]",
"icon": "logos:taurus.png",
@@ -2124,14 +2265,16 @@ class TaurusBaseWritableWidget(TaurusBaseWidget):
flags a "pending operation" which needs to be applied manually by
the user before the value gets written.
- :param auto: (bool) True for setting autoApply mode. False for disabling
+ :param auto: True for setting autoApply mode. False for disabling
+ :type auto: bool
"""
self._autoApply = auto
def getAutoApply(self):
"""whether autoApply mode is enabled or not.
- :return: (bool)
+ :return:
+ :rtype: bool
"""
return self._autoApply
@@ -2146,14 +2289,16 @@ class TaurusBaseWritableWidget(TaurusBaseWidget):
.. seealso: :meth:`forceApply` and :meth:`writeValue`
- :param forced: (bool) True for setting forcedApply mode. False for disabling
+ :param forced: True for setting forcedApply mode. False for disabling
+ :type forced: bool
"""
self._forcedApply = forced
def getForcedApply(self):
"""whether forcedApply mode is enabled or not.
- :return: (bool)
+ :return:
+ :rtype: bool
"""
return self._forcedApply
@@ -2181,9 +2326,9 @@ class TaurusBaseWritableWidget(TaurusBaseWidget):
It emits the applied signal if apply is not aborted.
- :param forceApply: (bool) If True, it behaves as in forceApply mode
- (even if the forceApply mode is disabled by
- :meth:`setForceApply`)
+ :param forceApply: If True, it behaves as in forceApply mode (even if
+ the forceApply mode is disabled by :meth:`setForceApply`)
+ :type forceApply: bool
"""
if self.hasPendingOperations():
applied = self.safeApplyOperations()
@@ -2205,7 +2350,6 @@ class TaurusBaseWritableWidget(TaurusBaseWidget):
It emits the applied signal if apply is not aborted.
.. seealso: :meth:`setForceApply` and :meth:`writeValue`
-
"""
try:
v = self.getValue()
@@ -2273,7 +2417,8 @@ class TaurusBaseWritableWidget(TaurusBaseWidget):
"""returns the operation callbacks (i.e., a sequence of methods that will be called after an operation is executed
(this default implementation it returns an empty list).
- :return: (sequence<callable>)
+ :return:
+ :rtype: sequence<callable>
"""
return []
diff --git a/lib/taurus/qt/qtgui/base/tauruscontroller.py b/lib/taurus/qt/qtgui/base/tauruscontroller.py
index b6291f3f..3b0c2557 100644
--- a/lib/taurus/qt/qtgui/base/tauruscontroller.py
+++ b/lib/taurus/qt/qtgui/base/tauruscontroller.py
@@ -24,7 +24,8 @@
##
#############################################################################
-"""This module provides the set of base class taurus controllers."""
+"""This module provides the set of base class taurus controllers.
+"""
import weakref
@@ -299,9 +300,8 @@ class TaurusConfigurationControllerHelper(object):
return val
-StyleSheetTemplate = (
- """border-style: outset; border-width: 2px; border-color: {0}; {1}"""
-)
+StyleSheetTemplate = """border-style: outset; border-width: 2px; border-color: {0}; {1}
+ """
def _updatePaletteColors(widget, bgBrush, fgBrush, frameBrush):
diff --git a/lib/taurus/qt/qtgui/base/test/__init__.py b/lib/taurus/qt/qtgui/base/test/__init__.py
index f0491da0..1f278624 100644
--- a/lib/taurus/qt/qtgui/base/test/__init__.py
+++ b/lib/taurus/qt/qtgui/base/test/__init__.py
@@ -23,4 +23,5 @@
##
#############################################################################
-"""Tests for taurus.qt.qtgui.base"""
+"""Tests for taurus.qt.qtgui.base
+"""
diff --git a/lib/taurus/qt/qtgui/base/test/test_taurusbase.py b/lib/taurus/qt/qtgui/base/test/test_taurusbase.py
index f236f57c..dbd1d1be 100644
--- a/lib/taurus/qt/qtgui/base/test/test_taurusbase.py
+++ b/lib/taurus/qt/qtgui/base/test/test_taurusbase.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Unit tests for taurusbase"""
+"""Unit tests for taurusbase
+"""
import pytest
diff --git a/lib/taurus/qt/qtgui/button/__init__.py b/lib/taurus/qt/qtgui/button/__init__.py
index c2ff4ef4..2fd7c6a2 100644
--- a/lib/taurus/qt/qtgui/button/__init__.py
+++ b/lib/taurus/qt/qtgui/button/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package contains a collection taurus Qt button widgets"""
+"""This package contains a collection taurus Qt button widgets
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/button/taurusbutton.py b/lib/taurus/qt/qtgui/button/taurusbutton.py
index a6c63bca..9d95e4c1 100644
--- a/lib/taurus/qt/qtgui/button/taurusbutton.py
+++ b/lib/taurus/qt/qtgui/button/taurusbutton.py
@@ -24,7 +24,8 @@
##
#############################################################################
-"""This module provides a taurus QPushButton based widgets"""
+"""This module provides a taurus QPushButton based widgets
+"""
from taurus.external.qt import Qt, compat
from taurus.core.taurusbasetypes import LockStatus, TaurusLockInfo
@@ -91,7 +92,6 @@ class TaurusLauncherButton(Qt.QPushButton, TaurusBaseWidget):
# a button that launches a taurusLabel (whose model is an attribute: 'a/b/c/attrname')
button = TaurusLauncherButton(widget = TaurusLabel())
button.setModel('a/b/c/attrname') # attr name, which will be set at the TaurusLabel when clicking
-
"""
_widgetClassName = ""
@@ -106,13 +106,18 @@ class TaurusLauncherButton(Qt.QPushButton, TaurusBaseWidget):
):
"""Constructor
- :param parent: (Qt.QWidget or None) parent of this widget
- :param designMode: (bool) flag for Qt designer
- :param widget: (Qt.QWidget) a QWidget that will be shown when clicking
- in the button
- :param icon: (Qt.QIcon) icon for the button
- :param text: (str) the button text (if None passed, the widget's class name
- is used)"""
+ :param parent: parent of this widget
+ :type parent: Qt.QWidget or None
+ :param designMode: flag for Qt designer
+ :type designMode: bool
+ :param widget: a QWidget that will be shown when clicking in the button
+ :type widget: Qt.QWidget
+ :param icon: icon for the button
+ :type icon: Qt.QIcon
+ :param text: the button text (if None passed, the widget's class name
+ is used)
+ :type text: str
+ """
name = self.__class__.__name__
self.call__init__wo_kw(Qt.QPushButton, parent)
@@ -140,7 +145,8 @@ class TaurusLauncherButton(Qt.QPushButton, TaurusBaseWidget):
def getModelClass(self):
"""see :meth:`TaurusBaseComponent.getModelClass`. Note that in the case of
:class:`TaurusLauncherButton`, the class is completely dependent on the
- widget's class"""
+ widget's class
+ """
try:
return self.widget().getModelClass()
except:
@@ -191,7 +197,8 @@ class TaurusLauncherButton(Qt.QPushButton, TaurusBaseWidget):
def setWidget(self, widget):
"""sets the widget that will be shown when clicking the button
- :param widget: (Qt.QWidget)
+ :param widget:
+ :type widget: Qt.QWidget
"""
self._dialog.setWidget(widget)
self._updateText()
@@ -217,7 +224,8 @@ class TaurusLauncherButton(Qt.QPushButton, TaurusBaseWidget):
"""
Slot called when the button is clicked.
Note that the dialog will only be created once. Subsequent clicks on
- the button will only raise the existing dialog"""
+ the button will only raise the existing dialog
+ """
if self.widget() is None:
self.createWidget()
self.widget().setModel(self.getModelName())
@@ -274,7 +282,8 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
button.setModel('a/b/c')
.. seealso:: :class:`TaurusCommandsForm` provides a good example of use of
- TaurusCommandButton (including managing the return value)"""
+ TaurusCommandButton (including managing the return value)
+ """
# TODO: tango-centric
commandExecuted = Qt.pyqtSignal(compat.PY_OBJECT)
@@ -291,13 +300,21 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
):
"""Constructor
- :param parent: (Qt.QWidget or None) parent of this widget
- :param designMode: (bool) flag for Qt designer
- :param command: (str) the name of the command to be executed
- :param parameters: (sequence<str>) the list of parameteres. Default value is None meaning no parameters
- :param icon: (Qt.QIcon) icon for the button
- :param text: (str) the button text (if None passed, `command` is used)
- :param timeout: (float) the command timeout (in seconds)
+ :param parent: parent of this widget
+ :type parent: Qt.QWidget or None
+ :param designMode: flag for Qt designer
+ :type designMode: bool
+ :param command: the name of the command to be executed
+ :type command: str
+ :param parameters: the list of parameteres. Default value is None
+ meaning no parameters
+ :type parameters: sequence<str>
+ :param icon: icon for the button
+ :type icon: Qt.QIcon
+ :param text: the button text (if None passed, `command` is used)
+ :type text: str
+ :param timeout: the command timeout (in seconds)
+ :type timeout: float
"""
name = self.__class__.__name__
if command is None:
@@ -339,7 +356,8 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
emits a "commandExecuted" signal with the result as well.
:return: The result of the command. The type depends on the command. It
- may be None.
+ may be None.
+
.. seealso:: :meth:`setCommand`, :meth:`setParameters`, :meth:`TaurusBaseComponent.isDangerous`
"""
@@ -392,14 +410,19 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
"""Internal method used to cast the command paramters to the appropriate
type required for the given command
- :param parameters: (sequence) a sequence of parameters. If None is
- passed, the currently set parameters are used.
- :param command: (str) the command name. If None is passed, the currently
- set command is used.
- :param dev: (taurus.core.taurusdevice.TaurusDevice) the device on which the command is
- executed. If None is passed, the current model is used.
+ :param parameters: a sequence of parameters. If None is passed, the
+ currently set parameters are used.
+ :type parameters: sequence
+ :param command: the command name. If None is passed, the currently set
+ command is used.
+ :type command: str
+ :param dev: the device on which the command is executed. If None is
+ passed, the current model is used.
+ :type dev: taurus.core.taurusdevice.TaurusDevice
+
- :return: (sequence or scalar) a sequence of parameters (or a scalar if only one parameter)
+ :return: a sequence of parameters (or a scalar if only one parameter)
+ :rtype: sequence or scalar
"""
import PyTango
@@ -451,7 +474,8 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
def setCommand(self, commandName):
"""sets the command to be executed when the button is clicked
- :param commandName: (str or None) the command name
+ :param commandName: the command name
+ :type commandName: str or None
"""
if commandName is None:
self._command = ""
@@ -462,7 +486,8 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
def getCommand(self):
"""returns the command name to be executed when the button is clicked
- :return: (str or None) the command name
+ :return: the command name
+ :rtype: str or None
"""
return self._command
@@ -474,16 +499,15 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
"""
Sets the parameters to be used on command execution.
- :param parameters: (sequence) a sequence of parameters. If the
- elements of the sequence are not of the right type
- required for the parameter, an automatic conversion
- will be attempted on execution time. As a special
- case, if parameters is a string not starting and
- ending in quote characters, it will be splitted on
- whitespace to obtain a sequence of parameters. If
- it is a string starting and ending with quotes, the
- quotes will be removed and the quoted text will not
- be splitted.
+ :param parameters: a sequence of parameters. If the elements of the
+ sequence are not of the right type required for the parameter, an
+ automatic conversion will be attempted on execution time. As a
+ special case, if parameters is a string not starting and ending in
+ quote characters, it will be splitted on whitespace to obtain a
+ sequence of parameters. If it is a string starting and ending with
+ quotes, the quotes will be removed and the quoted text will not be
+ splitted.
+ :type parameters: sequence
"""
if isinstance(parameters, str):
parameters = str(parameters).strip()
@@ -496,7 +520,8 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
def getParameters(self):
"""returns the parameters to be used on command execution
- :param parameters: (sequence)
+ :param parameters:
+ :type parameters: sequence
"""
return self._parameters
@@ -507,8 +532,9 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
def setCustomText(self, customText=None):
"""Sets a custom text for the button (by default it is the command name)
- :param customText: (str or None) the custom text. If None passed, it
- will use the command name
+ :param customText: the custom text. If None passed, it will use the
+ command name
+ :type customText: str or None
"""
self._customText = customText
self._setText(self.getDisplayValue())
@@ -530,8 +556,9 @@ class TaurusCommandButton(Qt.QPushButton, TaurusBaseWidget):
.. seealso:: :meth:`PyTango.DeviceProxy.command_inout`
- :param timeout: (float) the command timeout in seconds
- (timeout <0 or timeout=None disables the timeout)
+ :param timeout: the command timeout in seconds (timeout <0 or
+ timeout=None disables the timeout)
+ :type timeout: float
"""
if timeout < 0:
timeout = None
diff --git a/lib/taurus/qt/qtgui/button/test/test_commandbutton.py b/lib/taurus/qt/qtgui/button/test/test_commandbutton.py
index 2799cc7c..11a07f71 100644
--- a/lib/taurus/qt/qtgui/button/test/test_commandbutton.py
+++ b/lib/taurus/qt/qtgui/button/test/test_commandbutton.py
@@ -24,7 +24,8 @@
#############################################################################
-"""Unit tests for TaurusCommandButton"""
+"""Unit tests for TaurusCommandButton
+"""
import pytest
diff --git a/lib/taurus/qt/qtgui/compact/__init__.py b/lib/taurus/qt/qtgui/compact/__init__.py
index 98f80a0f..5b571a1d 100644
--- a/lib/taurus/qt/qtgui/compact/__init__.py
+++ b/lib/taurus/qt/qtgui/compact/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""This package contains a collection of taurus Qt widgets that combine other widgets
-to provide several functionalities in a reduced space"""
+to provide several functionalities in a reduced space
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/compact/abstractswitcher.py b/lib/taurus/qt/qtgui/compact/abstractswitcher.py
index 2da18a6b..9bbd12e5 100644
--- a/lib/taurus/qt/qtgui/compact/abstractswitcher.py
+++ b/lib/taurus/qt/qtgui/compact/abstractswitcher.py
@@ -91,7 +91,6 @@ class TaurusReadWriteSwitcher(TaurusWidget):
- signal from the write widget (a str representing a Signal signature)
#@todo: check integration with designer
-
"""
readWClass = None
@@ -160,7 +159,8 @@ class TaurusReadWriteSwitcher(TaurusWidget):
def _classifyTriggers(self, triggers):
"""classifies the diferent types of triggers
- :return: (tuple) a tuple of 3 lists: shortcuts,enventypes,signals
+ :return: a tuple of 3 lists: shortcuts,enventypes,signals
+ :rtype: tuple
"""
shortcuts = []
eventTypes = []
@@ -191,7 +191,8 @@ class TaurusReadWriteSwitcher(TaurusWidget):
"""set the read Widget to be used. You can reimplement this
method to tweak the read widget.
- :param widget: (QWidget) This should be Taurus widget
+ :param widget: This should be Taurus widget
+ :type widget: QWidget
"""
if self.readWidget is not None:
# @todo: relax this limitation
@@ -220,8 +221,9 @@ class TaurusReadWriteSwitcher(TaurusWidget):
"""set the write Widget to be used You can reimplement this
method to tweak the write widget.
- :param widget: (Qt.QWidget) This should be Taurus widget
- (typically a TaurusBaseWritableWidget)
+ :param widget: This should be Taurus widget (typically a
+ TaurusBaseWritableWidget)
+ :type widget: Qt.QWidget
"""
if self.writeWidget is not None:
# @todo: relax this limitation
@@ -278,7 +280,8 @@ class TaurusReadWriteSwitcher(TaurusWidget):
def _updateSizePolicy(self):
"""Update the size policy of the switcher widget to the most restrictive
- combination of the policies of the read and write widgets"""
+ combination of the policies of the read and write widgets
+ """
policy = None
for w in self.readWidget, self.writeWidget:
if w is not None:
diff --git a/lib/taurus/qt/qtgui/console/__init__.py b/lib/taurus/qt/qtgui/console/__init__.py
index 11c9a8b3..edb78331 100644
--- a/lib/taurus/qt/qtgui/console/__init__.py
+++ b/lib/taurus/qt/qtgui/console/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""DEPRECATED since 4.0,4. Use `silx.gui.console`"""
+"""DEPRECATED since 4.0,4. Use `silx.gui.console`
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/container/__init__.py b/lib/taurus/qt/qtgui/container/__init__.py
index 5a84400a..7354e208 100644
--- a/lib/taurus/qt/qtgui/container/__init__.py
+++ b/lib/taurus/qt/qtgui/container/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package provides generic taurus container widgets"""
+"""This package provides generic taurus container widgets
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/container/qcontainer.py b/lib/taurus/qt/qtgui/container/qcontainer.py
index ba6e896c..4d5e7a09 100644
--- a/lib/taurus/qt/qtgui/container/qcontainer.py
+++ b/lib/taurus/qt/qtgui/container/qcontainer.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides basic pure Qt container widgets"""
+"""This module provides basic pure Qt container widgets
+"""
import json
@@ -203,49 +204,65 @@ class QGroupWidget(Qt.QWidget):
def content(self):
"""Returns the contents widget
- :return: (Qt.QFrame) the content widget"""
+ :return: the content widget
+ :rtype: Qt.QFrame
+ """
return self._content
def titleBar(self):
"""Returns the title bar widget
- :return: (Qt.QFrame) the title bar widget"""
+ :return: the title bar widget
+ :rtype: Qt.QFrame
+ """
return self._titleBar
def titleButton(self):
"""Returns the title button widget
- :return: (Qt.QToolButton) the title button widget"""
+ :return: the title button widget
+ :rtype: Qt.QToolButton
+ """
return self._titleButton
def collapseButton(self):
"""Returns the collapse button widget
- :return: (Qt.QToolButton) the collapse button widget"""
+ :return: the collapse button widget
+ :rtype: Qt.QToolButton
+ """
return self._upDownButton
def setTitle(self, title):
"""Sets this widget's title
- :param title: (str) the new widget title"""
+ :param title: the new widget title
+ :type title: str
+ """
self._titleLabel.setText(title)
def getTitle(self):
"""Returns this widget's title
- :return: (str) this widget's title"""
+ :return: this widget's title
+ :rtype: str
+ """
return self._titleLabel.text()
def setTitleIcon(self, icon):
"""Sets this widget's title icon
- :param icon: (Qt.QIcon) the new widget title icon"""
+ :param icon: the new widget title icon
+ :type icon: Qt.QIcon
+ """
self._titleButton.setIcon(icon)
def getTitleIcon(self):
"""Returns this widget's title icon
- :return: (Qt.QIcon) this widget's title icon"""
+ :return: this widget's title icon
+ :rtype: Qt.QIcon
+ """
return self._titleButton.icon()
def switchContentVisible(self):
@@ -255,7 +272,9 @@ class QGroupWidget(Qt.QWidget):
def isContentVisible(self):
"""Returns this widget's contents visibility
- :return: (bool) this widget's contents visibility"""
+ :return: this widget's contents visibility
+ :rtype: bool
+ """
return self._contentVisible
def resetContentVisible(self):
@@ -265,7 +284,9 @@ class QGroupWidget(Qt.QWidget):
def setContentVisible(self, show):
"""Sets this widget's contents visibility
- :param show: (bool) the new widget contents visibility"""
+ :param show: the new widget contents visibility
+ :type show: bool
+ """
self._contentVisible = show
self._updateStyle()
@@ -286,7 +307,9 @@ class QGroupWidget(Qt.QWidget):
def isTitleVisible(self):
"""Returns this widget's title visibility
- :return: (bool) this widget's title visibility"""
+ :return: this widget's title visibility
+ :rtype: bool
+ """
return self._titleVisible
def resetTitleVisible(self):
@@ -296,7 +319,9 @@ class QGroupWidget(Qt.QWidget):
def setTitleVisible(self, show):
"""Sets this widget's title visibility
- :param icon: (bool) the new widget title visibility"""
+ :param icon: the new widget title visibility
+ :type icon: bool
+ """
self._titleVisible = show
self._titleBar.setVisible(show)
self._updateStyle()
@@ -304,13 +329,17 @@ class QGroupWidget(Qt.QWidget):
def getTitleHeight(self):
"""Returns this widget's title height
- :return: (bool) this widget's title height"""
+ :return: this widget's title height
+ :rtype: bool
+ """
return self.titleButton().iconSize().height()
def setTitleHeight(self, h):
"""Sets this widget's title height
- :param icon: (bool) the new widget title height"""
+ :param icon: the new widget title height
+ :type icon: bool
+ """
s = Qt.QSize(h, h)
self.titleButton().setIconSize(s)
self.collapseButton().setIconSize(s)
@@ -322,7 +351,9 @@ class QGroupWidget(Qt.QWidget):
def getTitleStyle(self):
"""Returns this widget's title style
- :return: (dict) this widget's title style"""
+ :return: this widget's title style
+ :rtype: dict
+ """
return self._titleBarStyle
def setTitleStyle(self, style_map):
@@ -333,7 +364,9 @@ class QGroupWidget(Qt.QWidget):
- 'font_color' : brush (Ex.: '#E0E0E0', 'rgb(0,0,0)', 'white')
- 'border_radius': radius (Ex.: '5px', '5px,2px')
- :param style_map: (dict) the new widget title style"""
+ :param style_map: the new widget title style
+ :type style_map: dict
+ """
style = self.DefaultTitleBarStyle.copy()
style.update(style_map)
self._titleBarStyle = style
@@ -346,7 +379,9 @@ class QGroupWidget(Qt.QWidget):
def getTitleStyleStr(self):
"""Returns this widget's title style
- :return: (dict) this widget's title style"""
+ :return: this widget's title style
+ :rtype: dict
+ """
return json.dumps(self._titleBarStyle)
def setTitleStyleStr(self, style_map):
@@ -357,7 +392,9 @@ class QGroupWidget(Qt.QWidget):
- 'font_color' : brush (Ex.: '#E0E0E0', 'rgb(0,0,0)', 'white')
- 'border_radius': radius (Ex.: '5px', '5px,2px')
- :param style_map: (dict) the new widget title style"""
+ :param style_map: the new widget title style
+ :type style_map: dict
+ """
style_map = json.loads(str(style_map))
self.setTitleStyle(style_map)
@@ -368,7 +405,9 @@ class QGroupWidget(Qt.QWidget):
def getContentStyle(self):
"""Returns this widget's content style
- :return: (dict) this widget's content style"""
+ :return: this widget's content style
+ :rtype: dict
+ """
return self._contentStyle
def setContentStyle(self, style_map):
@@ -377,7 +416,9 @@ class QGroupWidget(Qt.QWidget):
- 'start_color' : brush (Ex.: '#E0E0E0', 'rgb(0,0,0)', 'white')
- 'stop_color' : brush (Ex.: '#E0E0E0', 'rgb(0,0,0)', 'white')
- :param style_map: (dict) the new widget content style"""
+ :param style_map: the new widget content style
+ :type style_map: dict
+ """
style = self.DefaultContentStyle.copy()
style.update(style_map)
self._contentStyle = style
@@ -390,7 +431,9 @@ class QGroupWidget(Qt.QWidget):
def getContentStyleStr(self):
"""Returns this widget's content style
- :return: (dict) this widget's content style"""
+ :return: this widget's content style
+ :rtype: dict
+ """
return json.dumps(self._contentStyle)
def setContentStyleStr(self, style_map):
@@ -399,7 +442,9 @@ class QGroupWidget(Qt.QWidget):
- 'start_color' : brush (Ex.: '#E0E0E0', 'rgb(0,0,0)', 'white')
- 'stop_color' : brush (Ex.: '#E0E0E0', 'rgb(0,0,0)', 'white')
- :param style_map: (dict) the new widget content style"""
+ :param style_map: the new widget content style
+ :type style_map: dict
+ """
style_map = json.loads(str(style_map))
self.setContentStyle(style_map)
diff --git a/lib/taurus/qt/qtgui/container/taurusbasecontainer.py b/lib/taurus/qt/qtgui/container/taurusbasecontainer.py
index 72e7f74e..1fb3f04e 100644
--- a/lib/taurus/qt/qtgui/container/taurusbasecontainer.py
+++ b/lib/taurus/qt/qtgui/container/taurusbasecontainer.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides base class for all taurus container widgets"""
+"""This module provides base class for all taurus container widgets
+"""
__all__ = ["TaurusBaseContainer"]
@@ -67,10 +68,13 @@ class TaurusBaseContainer(TaurusBaseWidget):
returns a list of all taurus children of this taurus container (recurses down
skipping non-taurus widgets)
- :param objs: (list<objects>) if given, the search starts at the objects
- passed in this list
+ :param objs: if given, the search starts at the objects passed in this
+ list
+ :type objs: list<objects>
- :return: (list<TaurusBaseWidget>)
+
+ :return:
+ :rtype: list<TaurusBaseWidget>
"""
if objs is None:
objs = self.children()
diff --git a/lib/taurus/qt/qtgui/container/taurusframe.py b/lib/taurus/qt/qtgui/container/taurusframe.py
index 19eb1075..b7305b52 100644
--- a/lib/taurus/qt/qtgui/container/taurusframe.py
+++ b/lib/taurus/qt/qtgui/container/taurusframe.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides basic taurus container widgets"""
+"""This module provides basic taurus container widgets
+"""
from taurus.external.qt import Qt
from .taurusbasecontainer import TaurusBaseContainer
diff --git a/lib/taurus/qt/qtgui/container/taurusgroupbox.py b/lib/taurus/qt/qtgui/container/taurusgroupbox.py
index 222541fd..bbe37c94 100644
--- a/lib/taurus/qt/qtgui/container/taurusgroupbox.py
+++ b/lib/taurus/qt/qtgui/container/taurusgroupbox.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides basic taurus group box widget"""
+"""This module provides basic taurus group box widget
+"""
from taurus.external.qt import Qt
from .taurusbasecontainer import TaurusBaseContainer
diff --git a/lib/taurus/qt/qtgui/container/taurusgroupwidget.py b/lib/taurus/qt/qtgui/container/taurusgroupwidget.py
index 9788edb2..3579fa2f 100644
--- a/lib/taurus/qt/qtgui/container/taurusgroupwidget.py
+++ b/lib/taurus/qt/qtgui/container/taurusgroupwidget.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a taurus group widget"""
+"""This module provides a taurus group widget
+"""
from taurus.external.qt import Qt
from .qcontainer import QGroupWidget
diff --git a/lib/taurus/qt/qtgui/container/taurusmainwindow.py b/lib/taurus/qt/qtgui/container/taurusmainwindow.py
index 90f14f6c..47385fea 100644
--- a/lib/taurus/qt/qtgui/container/taurusmainwindow.py
+++ b/lib/taurus/qt/qtgui/container/taurusmainwindow.py
@@ -83,8 +83,9 @@ class ConfigurationDialog(Qt.QDialog, BaseConfigurableClass):
"""
Creates an entry in the "External Apps" tab of the configuration dialog
- :param extapp: (ExternalAppAction) the external application that is to
- be included in the configuration menu.
+ :param extapp: the external application that is to be included in the
+ configuration menu.
+ :type extapp: ExternalAppAction
"""
if self.externalAppsPage is None:
self.externalAppsPage = Qt.QScrollArea()
@@ -105,8 +106,9 @@ class ConfigurationDialog(Qt.QDialog, BaseConfigurableClass):
"""Remove the given external application configuration from
the "External Apps" tab of the configuration dialog
- :param extapp: (ExternalAppAction) the external application that is to
- be included in the configuration menu.
+ :param extapp: the external application that is to be included in the
+ configuration menu.
+ :type extapp: ExternalAppAction
"""
from taurus.external.qt import Qt
@@ -176,7 +178,6 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
- Taurus (accessible by derived classes as `self.taurusMenu`)
- Tools (accessible by derived classes as `self.toolsMenu`)
- Help (accessible by derived classes as `self.helpMenu`)
-
"""
modelChanged = Qt.pyqtSignal("const QString &")
@@ -398,8 +399,9 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
.. note:: This method may need be called by derived classes at the end
of their initialization.
- :return: (QMenu) the updated perspectives menu (or None if
- self.USER_PERSPECTIVES_ENABLED is False)
+ :return: the updated perspectives menu (or None if
+ self.USER_PERSPECTIVES_ENABLED is False)
+ :rtype: QMenu
"""
if not self.USER_PERSPECTIVES_ENABLED:
return None
@@ -428,14 +430,16 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
def splashScreen(self):
"""returns a the splashScreen
- :return: (QSplashScreen)
+ :return:
+ :rtype: QSplashScreen
"""
return self.__splashScreen
def basicTaurusToolbar(self):
"""returns a QToolBar with few basic buttons (most important, the logo)
- :return: (QToolBar)
+ :return:
+ :rtype: QToolBar
"""
tb = Qt.QToolBar("Taurus Toolbar")
tb.setObjectName("Taurus Toolbar")
@@ -641,7 +645,9 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
def setQSettings(self, settings):
"""sets the main window settings object
- :param settings: (QSettings or None)
+ :param settings:
+ :type settings: QSettings or None
+
.. seealso:: :meth:`getQSettings`
"""
@@ -656,7 +662,8 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
If it was not previously set, it will create a new QSettings object
following the Taurus convention i.e., it using Ini format and userScope)
- :return: (QSettings) the main window QSettings object
+ :return: the main window QSettings object
+ :rtype: QSettings
"""
if self.__settings is None:
self.__settings = self.newQSettings()
@@ -667,7 +674,8 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
The returned QSettings object will comply with the Taurus defaults for
storing application settings (i.e., it uses Ini format and userScope)
- :return: (QSettings) a taurus-specific QSettings object
+ :return: a taurus-specific QSettings object
+ :rtype: QSettings
"""
# using the ALBA-Controls Coding Convention on how to store application
# settings
@@ -686,7 +694,8 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
is the path of the module where the main window class is defined and
<appname> is the application name (as obtained from QApplication).
- :return: (str) the absolute file name.
+ :return: the absolute file name.
+ :rtype: str
"""
root, tail = os.path.split(
os.path.abspath(sys.modules[self.__module__].__file__)
@@ -706,18 +715,20 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
.. note:: This method should be called explicitly from derived classes after all
initialization is done
- :param settings: (QSettings or None) a QSettings object. If None given,
- the default one returned by :meth:`getQSettings` will
- be used
- :param group: (str) a prefix that will be added to the keys to be
- loaded (no prefix by default)
- :param ignoreGeometry: (bool) if True, the geometry of the MainWindow
- won't be restored
- :param factorySettingsFileName: (str) file name of a ini file containing the default
- settings to be used as a fallback in
- case the settings file is not found
- (e.g., the first time the application is
- launched after installation)
+ :param settings: a QSettings object. If None given, the default one
+ returned by :meth:`getQSettings` will be used
+ :type settings: QSettings or None
+ :param group: a prefix that will be added to the keys to be loaded (no
+ prefix by default)
+ :type group: str
+ :param ignoreGeometry: if True, the geometry of the MainWindow won't be
+ restored
+ :type ignoreGeometry: bool
+ :param factorySettingsFileName: file name of a ini file containing the
+ default settings to be used as a fallback in case the settings file
+ is not found (e.g., the first time the application is launched
+ after installation)
+ :type factorySettingsFileName: str
"""
if settings is None:
settings = self.getQSettings()
@@ -774,8 +785,9 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
.. note:: this method is automatically called by default when closing the
window, so in general there is no need to call it from derived classes
- :param group: (str) a prefix that will be added to the keys to be
- saved (no prefix by default)
+ :param group: a prefix that will be added to the keys to be saved (no
+ prefix by default)
+ :type group: str
"""
settings = self.getQSettings()
if not settings.isWritable():
@@ -799,7 +811,8 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
def savePerspective(self, name=None):
"""Stores current state of the application as a perspective with the given name
- :param name: (str) name of the perspective
+ :param name: name of the perspective
+ :type name: str
"""
perspectives = self.getPerspectivesList()
if name is None:
@@ -832,10 +845,11 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
"""Loads the settings saved for the given perspective.
It emits a 'perspectiveChanged' signal with name as its parameter
- :param name: (str) name of the perspective
- :param settings: (QSettings or None) a QSettings object. If None given,
- the default one returned by :meth:`getQSettings` will
- be used
+ :param name: name of the perspective
+ :type name: str
+ :param settings: a QSettings object. If None given, the default one
+ returned by :meth:`getQSettings` will be used
+ :type settings: QSettings or None
"""
if name is None:
perspectives = self.getPerspectivesList()
@@ -861,12 +875,13 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
def getPerspectivesList(self, settings=None):
"""Returns the list of saved perspectives
- :param settings: (QSettings or None) a QSettings object. If None given,
- the default one returned by :meth:`getQSettings` will
- be used
+ :param settings: a QSettings object. If None given, the default one
+ returned by :meth:`getQSettings` will be used
+ :type settings: QSettings or None
- :return: (QStringList) the list of the names of the currently saved
- perspectives
+
+ :return: the list of the names of the currently saved perspectives
+ :rtype: QStringList
"""
if settings is None:
settings = self.getQSettings()
@@ -880,10 +895,11 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
def removePerspective(self, name=None, settings=None):
"""removes the given perspective from the settings
- :param name: (str) name of the perspective
- :param settings: (QSettings or None) a QSettings object. If None given,
- the default one returned by :meth:`getQSettings` will
- be used
+ :param name: name of the perspective
+ :type name: str
+ :param settings: a QSettings object. If None given, the default one
+ returned by :meth:`getQSettings` will be used
+ :type settings: QSettings or None
"""
if settings is None:
settings = self.getQSettings()
@@ -916,7 +932,9 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
def exportSettingsFile(self, fname=None):
"""copies the current settings file into the given file name.
- :param fname: (str) name of output file. If None given, a file dialog will be shown.
+ :param fname: name of output file. If None given, a file dialog will be
+ shown.
+ :type fname: str
"""
if fname is None:
fname, _ = compat.getSaveFileName(
@@ -942,7 +960,9 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
loads settings (including importing all perspectives) from a given ini
file. It warns before overwriting an existing perspective.
- :param fname: (str) name of ini file. If None given, a file dialog will be shown.
+ :param fname: name of ini file. If None given, a file dialog will be
+ shown.
+ :type fname: str
"""
if fname is None:
fname, _ = compat.getOpenFileName(
@@ -984,15 +1004,19 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
Adds launchers for an external application to the Tools Menu
and/or to the Tools ToolBar.
- :param extapp: (ExternalAppAction or list<str>) the external application
- to be launched passed as a :class:`ExternalAppAction`
- (recommended because it allows to specify custom text and
- icon) or, alternatively, as a list of strings (sys.argv-
- like) that will be passed to :meth:`subprocess.Popen`.
- :param toToolBar: (bool) If True (default) a button will be added in the
- Tools toolBar
- :param toMenu: (bool) If True (default) an entry will be added in the
- Tools Menu, under the "External Applications" submenu
+ :param extapp: the external application to be launched passed as a
+ :class:`ExternalAppAction` (recommended because it allows to
+ specify custom text and icon) or, alternatively, as a list of
+ strings (sys.argv- like) that will be passed to
+ :meth:`subprocess.Popen`.
+ :type extapp: ExternalAppAction or list<str>
+ :param toToolBar: If True (default) a button will be added in the Tools
+ toolBar
+ :type toToolBar: bool
+ :param toMenu: If True (default) an entry will be added in the Tools
+ Menu, under the "External Applications" submenu
+ :type toMenu: bool
+
.. seealso:: :class:`ExternalAppAction`
"""
@@ -1029,8 +1053,9 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
Remove launchers for an external application to the Tools Menu
and/or to the Tools ToolBar.
- :param extapp: (ExternalAppAction) the external application
- to be removed passed as a :class:`ExternalAppAction`
+ :param extapp: the external application to be removed passed as a
+ :class:`ExternalAppAction`
+ :type extapp: ExternalAppAction
"""
self.configurationDialog.deleteExternalAppConfig(action)
try:
@@ -1204,7 +1229,8 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer):
The heartbeat is displayed by a Led in the status bar unless
it is disabled by setting the interval to 0
- :param interval: (int) heart beat interval in millisecs. Set to 0 to disable
+ :param interval: heart beat interval in millisecs. Set to 0 to disable
+ :type interval: int
"""
self.heartbeatLed.setBlinkingInterval(interval)
self.heartbeatLed.setVisible(interval > 0)
diff --git a/lib/taurus/qt/qtgui/container/taurusscrollarea.py b/lib/taurus/qt/qtgui/container/taurusscrollarea.py
index bdbd704e..e2ea276e 100644
--- a/lib/taurus/qt/qtgui/container/taurusscrollarea.py
+++ b/lib/taurus/qt/qtgui/container/taurusscrollarea.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides basic taurus scroll area widget"""
+"""This module provides basic taurus scroll area widget
+"""
from taurus.external.qt import Qt
from taurus.qt.qtgui.base import TaurusBaseComponent
@@ -50,7 +51,8 @@ class TaurusScrollArea(Qt.QScrollArea, TaurusBaseContainer):
widget.model = 'sys/database/2'
stateWidget = TaurusLabel()
layout.addWidget(stateWidget)
- stateWidget.model = 'sys/database/2/state'"""
+ stateWidget.model = 'sys/database/2/state'
+ """
modelChanged = Qt.pyqtSignal("const QString &")
diff --git a/lib/taurus/qt/qtgui/container/tauruswidget.py b/lib/taurus/qt/qtgui/container/tauruswidget.py
index 85b925c0..53b88060 100644
--- a/lib/taurus/qt/qtgui/container/tauruswidget.py
+++ b/lib/taurus/qt/qtgui/container/tauruswidget.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides basic taurus container widget"""
+"""This module provides basic taurus container widget
+"""
from taurus.external.qt import Qt
from .taurusbasecontainer import TaurusBaseContainer
diff --git a/lib/taurus/qt/qtgui/dialog/__init__.py b/lib/taurus/qt/qtgui/dialog/__init__.py
index 509d3b0b..718bbfc0 100644
--- a/lib/taurus/qt/qtgui/dialog/__init__.py
+++ b/lib/taurus/qt/qtgui/dialog/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""This package contains a collection of taurus Qt widgets representing various
-panels like forms or panels to be inserted in dialogs"""
+panels like forms or panels to be inserted in dialogs
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/dialog/taurusconfigurationdialog.py b/lib/taurus/qt/qtgui/dialog/taurusconfigurationdialog.py
index ac11c87f..fd77c08e 100644
--- a/lib/taurus/qt/qtgui/dialog/taurusconfigurationdialog.py
+++ b/lib/taurus/qt/qtgui/dialog/taurusconfigurationdialog.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a set of dialog based widgets"""
+"""This module provides a set of dialog based widgets
+"""
__all__ = ["TaurusConfigurationDialog"]
diff --git a/lib/taurus/qt/qtgui/dialog/taurusinputdialog.py b/lib/taurus/qt/qtgui/dialog/taurusinputdialog.py
index ac3d1e42..547f334c 100644
--- a/lib/taurus/qt/qtgui/dialog/taurusinputdialog.py
+++ b/lib/taurus/qt/qtgui/dialog/taurusinputdialog.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a set of dialog based widgets"""
+"""This module provides a set of dialog based widgets
+"""
from taurus.external.qt import Qt
@@ -72,15 +73,17 @@ def get_input(input_data, parent=None, input_panel_klass=None):
allow more than one value to be selected (makes sence when data_type
is a sequence of possibilities)
- :param input_data: a dictionary with information on how to build the input dialog
+ :param input_data: a dictionary with information on how to build the input
+ dialog
:type input_data: :py:obj:`dict`
:param parent: parent widget
:type parent: PyQt5.Qt.QWidget
- :param input_panel_klass: python class to be used as input panel [default: :class:`~taurus.qt.qtgui.panel.TaurusInputPanel`]
+ :param input_panel_klass: python class to be used as input panel [default:
+ :class:`~taurus.qt.qtgui.panel.TaurusInputPanel`]
:type input_panel_klass: :class:`~taurus.qt.qtgui.panel.TaurusInputPanel`
:return: a tuple containing value selected and boolean which is true if
- user accepted the dialog (pressed Ok) or false otherwise
+ user accepted the dialog (pressed Ok) or false otherwise
:rtype: tuple< obj, bool >
Examples::
@@ -104,7 +107,6 @@ def get_input(input_data, parent=None, input_panel_klass=None):
data_type='Text', key="Memo", default_value="By default a memo is a long thing")
for d in [d1, d2, d3, d4, d5, d6, d7, d8]:
get_input(input_data=d, title=d['prompt'])
-
"""
if input_panel_klass is None:
@@ -154,13 +156,15 @@ class TaurusInputDialog(Qt.QDialog):
"""Returns the :class:`taurus.qt.qtgui.panel.TaurusInputPanel`.
:return: the internal panel
- :rtype: taurus.qt.qtgui.panel.TaurusInputPanel"""
+ :rtype: taurus.qt.qtgui.panel.TaurusInputPanel
+ """
return self._panel
def value(self):
"""Returns the value selected by the user.
- :return: the value selected by the user"""
+ :return: the value selected by the user
+ """
return self.panel().value()
diff --git a/lib/taurus/qt/qtgui/dialog/taurusmessagebox.py b/lib/taurus/qt/qtgui/dialog/taurusmessagebox.py
index 74d35c19..3623d394 100644
--- a/lib/taurus/qt/qtgui/dialog/taurusmessagebox.py
+++ b/lib/taurus/qt/qtgui/dialog/taurusmessagebox.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a set of dialog based widgets"""
+"""This module provides a set of dialog based widgets
+"""
import sys
@@ -67,7 +68,8 @@ class TaurusMessageBox(Qt.QDialog):
if exc_info:
msgbox = TaurusMessageBox(*exc_info)
- msgbox.show()"""
+ msgbox.show()
+ """
def __init__(
self,
@@ -98,7 +100,8 @@ class TaurusMessageBox(Qt.QDialog):
"""Returns the :class:`taurus.qt.qtgui.panel.TaurusMessagePanel`.
:return: the internal panel
- :rtype: taurus.qt.qtgui.panel.TaurusMessagePanel"""
+ :rtype: taurus.qt.qtgui.panel.TaurusMessagePanel
+ """
return self._panel
def addButton(self, button, role=Qt.QDialogButtonBox.ActionRole):
@@ -107,35 +110,40 @@ class TaurusMessageBox(Qt.QDialog):
:param button: the button to be added
:type button: PyQt5.Qt.QPushButton
:param role: button role
- :type role: PyQt5.Qt.QDialogButtonBox.ButtonRole"""
+ :type role: PyQt5.Qt.QDialogButtonBox.ButtonRole
+ """
self.panel().addButton(button, role)
def setIconPixmap(self, pixmap):
"""Sets the icon to the dialog
:param pixmap: the icon pixmap
- :type pixmap: PyQt5.Qt.QPixmap"""
+ :type pixmap: PyQt5.Qt.QPixmap
+ """
self._panel.setIconPixmap(pixmap)
def setText(self, text):
"""Sets the text of the dialog
:param text: the new text
- :type text: str"""
+ :type text: str
+ """
self._panel.setText(text)
def getText(self):
"""Returns the current text of this panel
:return: the text for this panel
- :rtype: str"""
+ :rtype: str
+ """
return self._panel.getText()
def setDetailedText(self, text):
"""Sets the detailed text of the dialog
:param text: the new text
- :type text: str"""
+ :type text: str
+ """
self._panel.setDetailedText(text)
def setError(self, err_type=None, err_value=None, err_traceback=None):
@@ -154,15 +162,15 @@ class TaurusMessageBox(Qt.QDialog):
msgbox.setError(*exc_info)
msgbox.show()
- :param err_type: the exception type of the exception being handled
- (a class object)
+ :param err_type: the exception type of the exception being handled (a
+ class object)
:type error: class object
:param err_value: exception object
:type err_value: object
:param err_traceback: a traceback object which encapsulates the call
- stack at the point where the exception originally
- occurred
- :type err_traceback: TracebackType"""
+ stack at the point where the exception originally occurred
+ :type err_traceback: TracebackType
+ """
self._panel.setError(err_type, err_value, err_traceback)
@@ -256,12 +264,13 @@ class TaurusExceptHookMessageBox(BaseExceptHook):
"""A callable class that acts as an excepthook that displays an unhandled
exception in a :class:`~taurus.qt.qtgui.dialog.TaurusMessageBox`.
- :param hook_to: callable excepthook that will be called at the end of
- this hook handling [default: None]
+ :param hook_to: callable excepthook that will be called at the end of this
+ hook handling [default: None]
:type hook_to: callable
:param title: message box title [default: None meaning use exception value]
:type name: str
- :param msg: message box text [default: None meaning use exception]"""
+ :param msg: message box text [default: None meaning use exception]
+ """
MSG_BOX = None
diff --git a/lib/taurus/qt/qtgui/display/__init__.py b/lib/taurus/qt/qtgui/display/__init__.py
index a3e17212..3ca29570 100644
--- a/lib/taurus/qt/qtgui/display/__init__.py
+++ b/lib/taurus/qt/qtgui/display/__init__.py
@@ -25,7 +25,8 @@
"""This package contains a collection of taurus widgets designed to display taurus
information, typically in a read-only fashion (no user interaction is possible).
-Examples of widgets that suite this rule are labels, leds and LCDs"""
+Examples of widgets that suite this rule are labels, leds and LCDs
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/display/demo/__init__.py b/lib/taurus/qt/qtgui/display/demo/__init__.py
index 05ca6d4b..3ab62431 100644
--- a/lib/taurus/qt/qtgui/display/demo/__init__.py
+++ b/lib/taurus/qt/qtgui/display/demo/__init__.py
@@ -23,6 +23,7 @@
##
#############################################################################
-"""This package contains a collection of taurus display widgets demos"""
+"""This package contains a collection of taurus display widgets demos
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/display/demo/qpixmapwidgetdemo.py b/lib/taurus/qt/qtgui/display/demo/qpixmapwidgetdemo.py
index 0433583a..599b38ca 100644
--- a/lib/taurus/qt/qtgui/display/demo/qpixmapwidgetdemo.py
+++ b/lib/taurus/qt/qtgui/display/demo/qpixmapwidgetdemo.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides a demo for the
-:class:`taurus.qt.qtgui.display.TaurusLabel` widget """
+:class:`taurus.qt.qtgui.display.TaurusLabel` widget
+"""
__all__ = ["demo", "main"]
diff --git a/lib/taurus/qt/qtgui/display/demo/tauruslabeldemo.py b/lib/taurus/qt/qtgui/display/demo/tauruslabeldemo.py
index 264b44fd..147bbf00 100644
--- a/lib/taurus/qt/qtgui/display/demo/tauruslabeldemo.py
+++ b/lib/taurus/qt/qtgui/display/demo/tauruslabeldemo.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides a demo for the :class:`taurus.qt.qtgui.display.TaurusLabel`
-widget """
+widget
+"""
__all__ = ["demo", "main"]
diff --git a/lib/taurus/qt/qtgui/display/demo/tauruslcddemo.py b/lib/taurus/qt/qtgui/display/demo/tauruslcddemo.py
index 582b5ce2..1c73abdb 100644
--- a/lib/taurus/qt/qtgui/display/demo/tauruslcddemo.py
+++ b/lib/taurus/qt/qtgui/display/demo/tauruslcddemo.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides a demo for the :class:`~taurus.qt.qtgui.display.TaurusLCD`
-widget """
+widget
+"""
__all__ = ["demo", "main"]
diff --git a/lib/taurus/qt/qtgui/display/demo/taurusleddemo.py b/lib/taurus/qt/qtgui/display/demo/taurusleddemo.py
index cc013726..52718e2c 100644
--- a/lib/taurus/qt/qtgui/display/demo/taurusleddemo.py
+++ b/lib/taurus/qt/qtgui/display/demo/taurusleddemo.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides a demo for the :class:`taurus.qt.qtgui.display.TaurusLabel`
-widget """
+widget
+"""
__all__ = ["demo", "main"]
diff --git a/lib/taurus/qt/qtgui/display/qfallback.py b/lib/taurus/qt/qtgui/display/qfallback.py
index 3b10f6e7..95647f93 100644
--- a/lib/taurus/qt/qtgui/display/qfallback.py
+++ b/lib/taurus/qt/qtgui/display/qfallback.py
@@ -24,7 +24,8 @@
#############################################################################
"""A pure Qt widget designed to be displayed when a real widget cannot be
-loaded for any reason (example: a dependency library is not installed)"""
+loaded for any reason (example: a dependency library is not installed)
+"""
__all__ = [
"create_fallback",
@@ -57,7 +58,8 @@ def create_taurus_fallback(widget_klass_name):
class QFallBackWidget(Qt.QWidget):
"""A FallBack widget to be used when a real widget cannot be loaded for any
- reason (example: a dependency library is not installed)"""
+ reason (example: a dependency library is not installed)
+ """
def __init__(self, replaces=None, parent=None, *args, **kwargs):
Qt.QWidget.__init__(self, parent)
diff --git a/lib/taurus/qt/qtgui/display/qled.py b/lib/taurus/qt/qtgui/display/qled.py
index 424a95bb..e32e033c 100644
--- a/lib/taurus/qt/qtgui/display/qled.py
+++ b/lib/taurus/qt/qtgui/display/qled.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""A pure Qt led widget"""
+"""A pure Qt led widget
+"""
__all__ = ["LedColor", "LedStatus", "LedSize", "QLed", "QLedOld"]
@@ -81,7 +82,8 @@ class QLed(QPixmapWidget):
def minimumSizeHint(self):
"""Overwrite the default minimum size hint (0,0) to be (16,16)
:return: the minimum size hint 16,16
- :rtype: PyQt5.Qt.QSize"""
+ :rtype: PyQt5.Qt.QSize
+ """
return Qt.QSize(8, 8)
def toLedName(self, status=None, color=None, inverted=None):
@@ -93,7 +95,8 @@ class QLed(QPixmapWidget):
:param color: the color
:type color: str
:return: string containing the led name
- :rtype: str"""
+ :rtype: str
+ """
if status is None:
status = self._ledStatus
if color is None:
@@ -110,7 +113,8 @@ class QLed(QPixmapWidget):
:param color: the color
:type color: str
:return: True is the given color name is valid or False otherwise
- :rtype: bool"""
+ :rtype: bool
+ """
return name.upper() in LedColor
def _refresh(self):
@@ -136,7 +140,8 @@ class QLed(QPixmapWidget):
def getLedPatternName(self):
"""Returns the current led pattern name
:return: led pattern name
- :rtype: str"""
+ :rtype: str
+ """
return self._ledPatternName
def setLedPatternName(self, name):
@@ -151,7 +156,8 @@ class QLed(QPixmapWidget):
the led color is red.
:param name: new pattern
- :type name: str"""
+ :type name: str
+ """
self._ledPatternName = str(name)
self._refresh()
@@ -162,13 +168,15 @@ class QLed(QPixmapWidget):
def getLedStatus(self):
"""Returns the led status
:return: led status
- :rtype: bool"""
+ :rtype: bool
+ """
return self._ledStatus
def setLedStatus(self, status):
"""Sets the led status
:param status: the new status
- :type status: bool"""
+ :type status: bool
+ """
self._ledStatus = bool(status)
self._refresh()
@@ -183,13 +191,15 @@ class QLed(QPixmapWidget):
def getLedInverted(self):
"""Returns if the led is inverted.
:return: inverted mode
- :rtype: bool"""
+ :rtype: bool
+ """
return self._ledInverted
def setLedInverted(self, inverted):
"""Sets the led inverted mode
:param status: the new inverted mode
- :type status: bool"""
+ :type status: bool
+ """
self._ledInverted = bool(inverted)
self._refresh()
@@ -200,13 +210,15 @@ class QLed(QPixmapWidget):
def getLedColor(self):
"""Returns the led color
:return: led color
- :rtype: str"""
+ :rtype: str
+ """
return self._ledColor
def setLedColor(self, color):
"""Sets the led color
:param status: the new color
- :type status: str"""
+ :type status: str
+ """
color = str(color).lower()
if not self.isLedColorValid(color):
raise Exception("Invalid color '%s'" % color)
@@ -221,7 +233,9 @@ class QLed(QPixmapWidget):
"""sets the blinking interval (the time between status switching).
Set to a nonpositive number for disabling blinking
- :param interval: (int) the blinking interval in millisecs. Set to 0 for disabling blinking
+ :param interval: the blinking interval in millisecs. Set to 0 for
+ disabling blinking
+ :type interval: int
"""
if interval > 0:
if self._timer is None:
@@ -236,7 +250,8 @@ class QLed(QPixmapWidget):
def getBlinkingInterval(self):
"""returns the blinking interval
- :return: (int) blinking interval or 0 if blinking is not enabled.
+ :return: blinking interval or 0 if blinking is not enabled.
+ :rtype: int
"""
if self._timer is None:
return 0
diff --git a/lib/taurus/qt/qtgui/display/qlogo.py b/lib/taurus/qt/qtgui/display/qlogo.py
index 676ffbb0..5ef3964a 100644
--- a/lib/taurus/qt/qtgui/display/qlogo.py
+++ b/lib/taurus/qt/qtgui/display/qlogo.py
@@ -72,7 +72,9 @@ class QLogo(Qt.QLabel):
'icon' : 'logos:taurus.svg',
'container' : False }
- :return: (dict) a map with pertinent designer information"""
+ :return: a map with pertinent designer information
+ :rtype: dict
+ """
return {
"group": "Taurus Widgets",
"icon": "logos:taurus.png",
diff --git a/lib/taurus/qt/qtgui/display/qpixmapwidget.py b/lib/taurus/qt/qtgui/display/qpixmapwidget.py
index 63f0d8a5..ec071a81 100644
--- a/lib/taurus/qt/qtgui/display/qpixmapwidget.py
+++ b/lib/taurus/qt/qtgui/display/qpixmapwidget.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains a pure Qt widget that displays an image"""
+"""This module contains a pure Qt widget that displays an image
+"""
from taurus.external.qt import Qt
@@ -37,7 +38,8 @@ class QPixmapWidget(Qt.QWidget):
"""This widget displays an image (pixmap). By default the pixmap is
scaled to the widget size and the aspect ratio is kept.
The default alignment of the pixmap inside the widget space is horizontal
- left, vertical center."""
+ left, vertical center.
+ """
DefaultAlignment = Qt.Qt.AlignLeft | Qt.Qt.AlignVCenter
DefaultAspectRatioMode = Qt.Qt.KeepAspectRatio
@@ -113,13 +115,15 @@ class QPixmapWidget(Qt.QWidget):
def getPixmap(self):
"""Returns the pixmap.Returns None if no pixmap is set.
:return: the current pixmap
- :rtype: PyQt5.Qt.QPixmap"""
+ :rtype: PyQt5.Qt.QPixmap
+ """
return self._pixmap
def setPixmap(self, pixmap):
"""Sets the pixmap for this widget. Setting it to None disables pixmap
:param pixmap: the new pixmap
- :type pixmap: PyQt5.Qt.QPixmap"""
+ :type pixmap: PyQt5.Qt.QPixmap
+ """
# make sure to make a copy because of bug in PyQt 4.4. This is actually
# copying the internal bitmap, just the qpixmap, so there is no performance
# penalty here
@@ -134,13 +138,15 @@ class QPixmapWidget(Qt.QWidget):
def getAspectRatioMode(self):
"""Returns the aspect ratio to apply when drawing the pixmap.
:return: the current aspect ratio
- :rtype: PyQt5.Qt.AspectRatioMode"""
+ :rtype: PyQt5.Qt.AspectRatioMode
+ """
return self._pixmapAspectRatioMode
def setAspectRatioMode(self, aspect):
"""Sets the aspect ratio mode to apply when drawing the pixmap.
:param pixmap: the new aspect ratio mode
- :type pixmap: PyQt5.Qt.AspectRatioMode"""
+ :type pixmap: PyQt5.Qt.AspectRatioMode
+ """
self._pixmapAspectRatioMode = aspect
self._setDirty()
self.update()
@@ -152,13 +158,15 @@ class QPixmapWidget(Qt.QWidget):
def getTransformationMode(self):
"""Returns the transformation mode to apply when drawing the pixmap.
:return: the current transformation mode
- :rtype: PyQt5.Qt.TransformationMode"""
+ :rtype: PyQt5.Qt.TransformationMode
+ """
return self._pixmapTransformationMode
def setTransformationMode(self, transformation):
"""Sets the transformation mode to apply when drawing the pixmap.
:param pixmap: the new transformation mode
- :type pixmap: PyQt5.Qt.TransformationMode"""
+ :type pixmap: PyQt5.Qt.TransformationMode
+ """
self._pixmapTransformationMode = transformation
self._setDirty()
self.update()
@@ -170,13 +178,15 @@ class QPixmapWidget(Qt.QWidget):
def getAlignment(self):
"""Returns the alignment to apply when drawing the pixmap.
:return: the current alignment
- :rtype: PyQt5.Qt.Alignment"""
+ :rtype: PyQt5.Qt.Alignment
+ """
return self._alignment
def setAlignment(self, alignment):
"""Sets the alignment to apply when drawing the pixmap.
:param pixmap: the new alignment
- :type pixmap: PyQt5.Qt.Alignment"""
+ :type pixmap: PyQt5.Qt.Alignment
+ """
self._alignment = Qt.Qt.Alignment(alignment)
self.update()
diff --git a/lib/taurus/qt/qtgui/display/tauruslabel.py b/lib/taurus/qt/qtgui/display/tauruslabel.py
index 30d88972..e2417982 100644
--- a/lib/taurus/qt/qtgui/display/tauruslabel.py
+++ b/lib/taurus/qt/qtgui/display/tauruslabel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a set of basic Taurus widgets based on QLabel"""
+"""This module provides a set of basic Taurus widgets based on QLabel
+"""
from collections.abc import Sequence
import re
@@ -482,7 +483,8 @@ class TaurusLabel(Qt.QLabel, TaurusBaseWidget):
"""Enable/disable auto-trimming of the text. If trim is True, the text
in the label will be trimmed when it doesn't fit in the available space
- :param trim: (bool)
+ :param trim:
+ :type trim: bool
"""
self._autoTrim = trim
self.controllerUpdate()
@@ -506,7 +508,8 @@ class TaurusLabel(Qt.QLabel, TaurusBaseWidget):
"""
Whether auto-trimming of the text is enabled.
- :return: (bool)
+ :return:
+ :rtype: bool
"""
return self._autoTrim
diff --git a/lib/taurus/qt/qtgui/display/tauruslcd.py b/lib/taurus/qt/qtgui/display/tauruslcd.py
index f1a2cdeb..1f576f8f 100644
--- a/lib/taurus/qt/qtgui/display/tauruslcd.py
+++ b/lib/taurus/qt/qtgui/display/tauruslcd.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a Taurus widget based on QLCDNumber"""
+"""This module provides a Taurus widget based on QLCDNumber
+"""
from collections.abc import Sequence
@@ -206,7 +207,8 @@ def Controller(lcd):
class TaurusLCD(Qt.QLCDNumber, TaurusBaseWidget):
"""A Taurus-enabled :class:`Qt.QLCDNumber` widget. Its text can represent
either the rvalue or wvalue *magnitude* (or nothing), and the background
- can colour-code the attribute quality or the device state (or nothing)"""
+ can colour-code the attribute quality or the device state (or nothing)
+ """
DefaultBgRole = "quality"
DefaultFgRole = "value"
diff --git a/lib/taurus/qt/qtgui/display/taurusled.py b/lib/taurus/qt/qtgui/display/taurusled.py
index 9256629b..a65b645b 100644
--- a/lib/taurus/qt/qtgui/display/taurusled.py
+++ b/lib/taurus/qt/qtgui/display/taurusled.py
@@ -24,7 +24,8 @@
##
#############################################################################
-"""This module provides a set of basic Taurus widgets based on QLed"""
+"""This module provides a set of basic Taurus widgets based on QLed
+"""
import weakref
from collections.abc import Sequence
@@ -208,7 +209,8 @@ class _TaurusLedControllerDesignMode(_TaurusLedController):
class TaurusLed(QLed, TaurusBaseWidget):
"""A widget designed to represent with a LED image the state of a device,
- the value of a boolean attribute or the quality of an attribute."""
+ the value of a boolean attribute or the quality of an attribute.
+ """
DefaultModelIndex = None
DefaultFgRole = "rvalue"
@@ -301,13 +303,15 @@ class TaurusLed(QLed, TaurusBaseWidget):
def getOnColor(self):
"""Returns the preferred led on color
:return: led on color
- :rtype: str"""
+ :rtype: str
+ """
return self._onColor
def setOnColor(self, color):
"""Sets the preferred led on color
:param status: the new on color
- :type status: str"""
+ :type status: str
+ """
color = str(color).lower()
if not self.isLedColorValid(color):
raise Exception("Invalid color '%s'" % color)
@@ -321,13 +325,15 @@ class TaurusLed(QLed, TaurusBaseWidget):
def getOffColor(self):
"""Returns the preferred led off color
:return: led off color
- :rtype: str"""
+ :rtype: str
+ """
return self._offColor
def setOffColor(self, color):
"""Sets the preferred led off color
:param status: the new off color
- :type status: str"""
+ :type status: str
+ """
color = str(color).lower()
if not self.isLedColorValid(color):
raise Exception("Invalid color '%s'" % color)
diff --git a/lib/taurus/qt/qtgui/display/test/test_tauruslabel.py b/lib/taurus/qt/qtgui/display/test/test_tauruslabel.py
index 3c07236a..e47be709 100644
--- a/lib/taurus/qt/qtgui/display/test/test_tauruslabel.py
+++ b/lib/taurus/qt/qtgui/display/test/test_tauruslabel.py
@@ -22,7 +22,8 @@
##
#############################################################################
-"""Unit tests for Taurus Label"""
+"""Unit tests for Taurus Label
+"""
from taurus.qt.qtgui.display import TaurusLabel
diff --git a/lib/taurus/qt/qtgui/editor/__init__.py b/lib/taurus/qt/qtgui/editor/__init__.py
index e008d276..ac968693 100644
--- a/lib/taurus/qt/qtgui/editor/__init__.py
+++ b/lib/taurus/qt/qtgui/editor/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package contains a collection of taurus text editor widgets"""
+"""This package contains a collection of taurus text editor widgets
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/editor/tauruseditor.py b/lib/taurus/qt/qtgui/editor/tauruseditor.py
index fe959607..b84c4bcc 100644
--- a/lib/taurus/qt/qtgui/editor/tauruseditor.py
+++ b/lib/taurus/qt/qtgui/editor/tauruseditor.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains a taurus text editor widget."""
+"""This module contains a taurus text editor widget.
+"""
__all__ = ["TaurusBaseEditor"]
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/__init__.py b/lib/taurus/qt/qtgui/extra_guiqwt/__init__.py
index d5ce9da5..b291826b 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/__init__.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides the glue between taurus and guiqwt. It essentially provides taurus extensions to qwtgui"""
+"""This module provides the glue between taurus and guiqwt. It essentially provides taurus extensions to qwtgui
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/builder.py b/lib/taurus/qt/qtgui/extra_guiqwt/builder.py
index 4d6e2e90..72fa3aea 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/builder.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/builder.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Extension of :mod:`guiqwt.builder`"""
+"""Extension of :mod:`guiqwt.builder`
+"""
import guiqwt.builder
import numpy
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/curve.py b/lib/taurus/qt/qtgui/extra_guiqwt/curve.py
index af7273bc..90950771 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/curve.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/curve.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Extension of :mod:`guiqwt.curve`"""
+"""Extension of :mod:`guiqwt.curve`
+"""
from taurus.external.qt import Qt
from taurus.qt.qtgui.base import TaurusBaseComponent
@@ -159,7 +160,8 @@ class TaurusTrendItem(CurveItem, TaurusBaseComponent):
def setBufferSize(self, buffersize):
"""sets the size of the stack.
- :param buffersize: (int) size of the stack
+ :param buffersize: size of the stack
+ :type buffersize: int
"""
self.taurusparam.maxBufferSize = buffersize
try:
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/curvesmodel.py b/lib/taurus/qt/qtgui/extra_guiqwt/curvesmodel.py
index b5076841..49c015f0 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/curvesmodel.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/curvesmodel.py
@@ -163,7 +163,8 @@ class CurveItemConf(object):
@staticmethod
def fromAny(obj):
"""return a CurveItemConf from whatever given in input (if possible).
- Raises ValueError if not possible"""
+ Raises ValueError if not possible
+ """
if isinstance(obj, CurveItemConf):
return copy.deepcopy(obj)
try:
@@ -527,12 +528,15 @@ class CurveItemConfDlg(Qt.QWidget):
def showDlg(parent=None, curves=None):
"""Static method that launches a modal dialog containing a CurveItemConfDlg
- :param parent: (QObject) parent for the dialog
+ :param parent: parent for the dialog
+ :type parent: QObject
+
- :return: (list,bool or QMimeData,bool) Returns a models,ok tuple. models can be
- either a list of models or a QMimeData object, depending on
- `asMimeData`. ok is True if the dialog was accepted (by
- clicking on the "update" button) and False otherwise
+ :return: Returns a models,ok tuple. models can be either a list of
+ models or a QMimeData object, depending on `asMimeData`. ok is True
+ if the dialog was accepted (by clicking on the "update" button) and
+ False otherwise
+ :rtype: list,bool or QMimeData,bool
"""
dlg = Qt.QDialog(parent)
dlg.setWindowTitle("Curves Selection")
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/image.py b/lib/taurus/qt/qtgui/extra_guiqwt/image.py
index 0b37ef66..7ea6d5bb 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/image.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/image.py
@@ -277,8 +277,10 @@ class TaurusTrend2DItem(XYImageItem, TaurusBaseComponent):
def __init__(self, param=None, buffersize=512, stackMode="datetime"):
"""
:param param: param to be passed to XYImageItem constructor
- :param buffersize: (int) size of the stack
- :param stackMode: (str) can be 'datetime', 'timedelta' or 'event'
+ :param buffersize: size of the stack
+ :type buffersize: int
+ :param stackMode: can be 'datetime', 'timedelta' or 'event'
+ :type stackMode: str
"""
XYImageItem.__init__(
self,
@@ -321,7 +323,8 @@ class TaurusTrend2DItem(XYImageItem, TaurusBaseComponent):
def setBufferSize(self, buffersize):
"""sets the size of the stack
- :param buffersize: (int) size of the stack
+ :param buffersize: size of the stack
+ :type buffersize: int
"""
self.maxBufferSize = buffersize
try:
@@ -522,7 +525,6 @@ class TaurusTrend2DScanItem(TaurusTrend2DItem):
"""Receives a recordData dictionary and updates the curves associated to it
.. seealso:: <Sardana>/MacroServer/scan/scandata.py:Record.data
-
"""
# obtain the x value
try:
@@ -612,7 +614,8 @@ class TaurusTrend2DScanItem(TaurusTrend2DItem):
def connectWithQDoor(self, doorname):
"""connects this TaurusTrend2DScanItem to a QDoor
- :param doorname: (str) the QDoor name
+ :param doorname: the QDoor name
+ :type doorname: str
"""
qdoor = taurus.Device(doorname)
qdoor.recordDataUpdated.connect(self.scanDataReceived)
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/plot.py b/lib/taurus/qt/qtgui/extra_guiqwt/plot.py
index 538650b9..18d551f3 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/plot.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/plot.py
@@ -109,15 +109,15 @@ class TaurusCurveDialog(CurveDialog, TaurusBaseWidget):
def setModel(self, modelNames):
"""Removes current TaurusCurveItems and adds new ones.
- :param modelNames: (sequence<str> or str) the names of the models to be
- plotted. For convenience, a string is also accepted
- (instead of a sequence of strings), in which case the
- string will be internally converted to a sequence by
- splitting it on whitespace and commas. Each model can
- optionally be composed of two parts, separated by "|"
- indicating X and Y components for the curve. If only
- one part is given, it is used for Y and X is
- automatically generated as an index.
+ :param modelNames: the names of the models to be plotted. For
+ convenience, a string is also accepted (instead of a sequence of
+ strings), in which case the string will be internally converted to
+ a sequence by splitting it on whitespace and commas. Each model can
+ optionally be composed of two parts, separated by "|" indicating X
+ and Y components for the curve. If only one part is given, it is
+ used for Y and X is automatically generated as an index.
+ :type modelNames: sequence<str> or str
+
.. seealso:: :meth:`addModels`
"""
@@ -142,15 +142,15 @@ class TaurusCurveDialog(CurveDialog, TaurusBaseWidget):
is only a more Taurus-oriented interface. :meth:`add_items`
gives you more control.
- :param modelNames: (sequence<str> or str) the names of the models to be
- plotted. For convenience, string is also accepted
- (instead of a sequence of strings), in which case the
- string will be internally converted to a sequence by
- splitting it on whitespace and commas. Each model can
- optionally be composed of two parts, separated by "|"
- indicating X and Y components for the curve. If only
- one part is given, it is used for Y and X is
- automatically generated as an index.
+ :param modelNames: the names of the models to be plotted. For
+ convenience, string is also accepted (instead of a sequence of
+ strings), in which case the string will be internally converted to
+ a sequence by splitting it on whitespace and commas. Each model can
+ optionally be composed of two parts, separated by "|" indicating X
+ and Y components for the curve. If only one part is given, it is
+ used for Y and X is automatically generated as an index.
+ :type modelNames: sequence<str> or str
+
.. seealso:: :meth:`add_item`
"""
@@ -296,11 +296,12 @@ class TaurusTrendDialog(CurveDialog, TaurusBaseWidget):
def setModel(self, modelNames):
"""Removes current TaurusCurveItems and adds new ones.
- :param modelNames: (sequence<str> or str) the names of the models to be
- plotted. For convenience, a string is also accepted
- (instead of a sequence of strings), in which case the
- string will be internally converted to a sequence by
- splitting it on whitespace and commas.
+ :param modelNames: the names of the models to be plotted. For
+ convenience, a string is also accepted (instead of a sequence of
+ strings), in which case the string will be internally converted to
+ a sequence by splitting it on whitespace and commas.
+ :type modelNames: sequence<str> or str
+
.. seealso:: :meth:`addModels`
"""
@@ -321,11 +322,12 @@ class TaurusTrendDialog(CurveDialog, TaurusBaseWidget):
is only a more Taurus-oriented interface. :meth:`add_items`
gives you more control.
- :param modelNames: (sequence<str> or str) the names of the models to be
- plotted. For convenience, a string is also accepted
- (instead of a sequence of strings), in which case the
- string will be internally converted to a sequence by
- splitting it on whitespace and commas.
+ :param modelNames: the names of the models to be plotted. For
+ convenience, a string is also accepted (instead of a sequence of
+ strings), in which case the string will be internally converted to
+ a sequence by splitting it on whitespace and commas.
+ :type modelNames: sequence<str> or str
+
.. seealso:: :meth:`add_item`
"""
@@ -363,7 +365,8 @@ class TaurusTrendDialog(CurveDialog, TaurusBaseWidget):
"""enables/disables looking up in the archiver for data stored before
the Trend was started
- :param enable: (bool) if True, archiving values will be used if available
+ :param enable: if True, archiving values will be used if available
+ :type enable: bool
"""
if not self.defaultTaurusparam.stackMode == "datetime":
self.info("ignoring setUseArchiving. Reason: not in X time scale")
@@ -372,7 +375,9 @@ class TaurusTrendDialog(CurveDialog, TaurusBaseWidget):
def getUseArchiving(self):
"""whether TaurusTrend is looking for data in the archiver when needed
- :return: (bool)
+ :return:
+ :rtype: bool
+
.. seealso:: :meth:`setUseArchiving`
"""
@@ -385,7 +390,9 @@ class TaurusTrendDialog(CurveDialog, TaurusBaseWidget):
def setMaxDataBufferSize(self, maxSize):
"""sets the maximum number of events that will be stacked
- :param maxSize: (int) the maximum limit
+ :param maxSize: the maximum limit
+ :type maxSize: int
+
.. seealso:: :class:`TaurusTrendSet`
"""
@@ -397,7 +404,8 @@ class TaurusTrendDialog(CurveDialog, TaurusBaseWidget):
def getMaxDataBufferSize(self):
"""returns the maximum number of events that can be plotted in the trend
- :return: (int)
+ :return:
+ :rtype: int
"""
return self.defaultTaurusparam.maxBufferSize
@@ -413,7 +421,8 @@ class TaurusTrendDialog(CurveDialog, TaurusBaseWidget):
- as time deltas ('timedelta')
- as event numbers ('event')
- :param mode:(one of 'datetime', 'timedelta' or 'event')
+ :param mode:
+ :type mode: one of 'datetime', 'timedelta' or 'event'
"""
from taurus.qt.qtgui.extra_guiqwt.tools import TimeAxisTool
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/scales.py b/lib/taurus/qt/qtgui/extra_guiqwt/scales.py
index c0d95dec..75e782e7 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/scales.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/scales.py
@@ -53,10 +53,14 @@ def _getDefaultAxisLabelsAlignment(axis, rotation):
"""return a "smart" alignment for the axis labels depending on the axis
and the label rotation
- :param axis: (qwt.QwtPlot.Axis) the axis
- :param rotation: (float) The rotation (in degrees, clockwise-positive)
+ :param axis: the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param rotation: The rotation (in degrees, clockwise-positive)
+ :type rotation: float
- :return: (Qt.Alignment) an alignment
+
+ :return: an alignment
+ :rtype: Qt.Alignment
"""
if axis == qwt.QwtPlot.xBottom:
if rotation == 0:
@@ -144,8 +148,10 @@ class DateTimeScaleEngine(qwt.QwtLinearScaleEngine):
**Important**: The stepSize parameter is **ignored**.
- :return: (qwt.QwtScaleDiv) a scale division whose ticks are aligned with
- the natural time units"""
+ :return: a scale division whose ticks are aligned with the natural time
+ units
+ :rtype: qwt.QwtScaleDiv
+ """
# if stepSize != 0:
# scaleDiv = qwt.QwtLinearScaleEngine.divideScale(self, x1, x2, maxMajSteps, maxMinSteps, stepSize)
@@ -262,10 +268,14 @@ class DateTimeScaleEngine(qwt.QwtLinearScaleEngine):
"""return a "smart" alignment for the axis labels depending on the axis
and the label rotation
- :param axis: (qwt.QwtPlot.Axis) the axis
- :param rotation: (float) The rotation (in degrees, clockwise-positive)
+ :param axis: the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param rotation: The rotation (in degrees, clockwise-positive)
+ :type rotation: float
- :return: (Qt.Alignment) an alignment
+
+ :return: an alignment
+ :rtype: Qt.Alignment
"""
return _getDefaultAxisLabelsAlignment(axis, rotation)
@@ -274,12 +284,17 @@ class DateTimeScaleEngine(qwt.QwtLinearScaleEngine):
"""convenience method that will enable this engine in the given
axis. Note that it changes the ScaleDraw as well.
- :param plot: (qwt.QwtPlot) the plot to change
- :param axis: (qwt.QwtPlot.Axis) the id of the axis
- :param scaleDraw: (qwt.QwtScaleDraw) Scale draw to use. If None given,
- the current ScaleDraw for the plot will be used if
- possible, and a :class:`TaurusTimeScaleDraw` will be set if not
- :param rotation: (float or None) The rotation of the labels (in degrees, clockwise-positive)
+ :param plot: the plot to change
+ :type plot: qwt.QwtPlot
+ :param axis: the id of the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param scaleDraw: Scale draw to use. If None given, the current
+ ScaleDraw for the plot will be used if possible, and a
+ :class:`TaurusTimeScaleDraw` will be set if not
+ :type scaleDraw: qwt.QwtScaleDraw
+ :param rotation: The rotation of the labels (in degrees, clockwise-
+ positive)
+ :type rotation: float or None
"""
if scaleDraw is None:
scaleDraw = plot.axisScaleDraw(axis)
@@ -299,12 +314,16 @@ class DateTimeScaleEngine(qwt.QwtLinearScaleEngine):
"""convenience method that will disable this engine in the given
axis. Note that it changes the ScaleDraw as well.
- :param plot: (qwt.QwtPlot) the plot to change
- :param axis: (qwt.QwtPlot.Axis) the id of the axis
- :param scaleDraw: (qwt.QwtScaleDraw) Scale draw to use. If None given,
- a :class:`FancyScaleDraw` will be set
- :param scaleEngine: (qwt.QwtScaleEngine) Scale draw to use. If None given,
- a :class:`qwt.QwtLinearScaleEngine` will be set
+ :param plot: the plot to change
+ :type plot: qwt.QwtPlot
+ :param axis: the id of the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param scaleDraw: Scale draw to use. If None given, a
+ :class:`FancyScaleDraw` will be set
+ :type scaleDraw: qwt.QwtScaleDraw
+ :param scaleEngine: Scale draw to use. If None given, a
+ :class:`qwt.QwtLinearScaleEngine` will be set
+ :type scaleEngine: qwt.QwtScaleEngine
"""
if scaleDraw is None:
scaleDraw = FancyScaleDraw()
@@ -356,8 +375,10 @@ class DeltaTimeScaleEngine(qwt.QwtLinearScaleEngine):
def divideScale(self, x1, x2, maxMajSteps, maxMinSteps, stepSize):
"""Reimplements qwt.QwtLinearScaleEngine.divideScale
- :return: (qwt.QwtScaleDiv) a scale division whose ticks are aligned with
- the natural delta time units"""
+ :return: a scale division whose ticks are aligned with the natural
+ delta time units
+ :rtype: qwt.QwtScaleDiv
+ """
interval = qwt.QwtInterval(x1, x2).normalized()
if interval.width() <= 0:
return qwt.QwtScaleDiv()
@@ -390,10 +411,14 @@ class DeltaTimeScaleEngine(qwt.QwtLinearScaleEngine):
"""return a "smart" alignment for the axis labels depending on the axis
and the label rotation
- :param axis: (qwt.QwtPlot.Axis) the axis
- :param rotation: (float) The rotation (in degrees, clockwise-positive)
+ :param axis: the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param rotation: The rotation (in degrees, clockwise-positive)
+ :type rotation: float
- :return: (Qt.Alignment) an alignment
+
+ :return: an alignment
+ :rtype: Qt.Alignment
"""
return _getDefaultAxisLabelsAlignment(axis, rotation)
@@ -402,12 +427,17 @@ class DeltaTimeScaleEngine(qwt.QwtLinearScaleEngine):
"""convenience method that will enable this engine in the given
axis. Note that it changes the ScaleDraw as well.
- :param plot: (qwt.QwtPlot) the plot to change
- :param axis: (qwt.QwtPlot.Axis) the id of the axis
- :param scaleDraw: (qwt.QwtScaleDraw) Scale draw to use. If None given,
- the current ScaleDraw for the plot will be used if
- possible, and a :class:`TaurusTimeScaleDraw` will be set if not
- :param rotation: (float or None) The rotation of the labels (in degrees, clockwise-positive)
+ :param plot: the plot to change
+ :type plot: qwt.QwtPlot
+ :param axis: the id of the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param scaleDraw: Scale draw to use. If None given, the current
+ ScaleDraw for the plot will be used if possible, and a
+ :class:`TaurusTimeScaleDraw` will be set if not
+ :type scaleDraw: qwt.QwtScaleDraw
+ :param rotation: The rotation of the labels (in degrees, clockwise-
+ positive)
+ :type rotation: float or None
"""
if scaleDraw is None:
scaleDraw = plot.axisScaleDraw(axis)
@@ -427,12 +457,16 @@ class DeltaTimeScaleEngine(qwt.QwtLinearScaleEngine):
"""convenience method that will disable this engine in the given
axis. Note that it changes the ScaleDraw as well.
- :param plot: (qwt.QwtPlot) the plot to change
- :param axis: (qwt.QwtPlot.Axis) the id of the axis
- :param scaleDraw: (qwt.QwtScaleDraw) Scale draw to use. If None given,
- a :class:`FancyScaleDraw` will be set
- :param scaleEngine: (qwt.QwtScaleEngine) Scale draw to use. If None given,
- a :class:`qwt.QwtLinearScaleEngine` will be set
+ :param plot: the plot to change
+ :type plot: qwt.QwtPlot
+ :param axis: the id of the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param scaleDraw: Scale draw to use. If None given, a
+ :class:`FancyScaleDraw` will be set
+ :type scaleDraw: qwt.QwtScaleDraw
+ :param scaleEngine: Scale draw to use. If None given, a
+ :class:`qwt.QwtLinearScaleEngine` will be set
+ :type scaleEngine: qwt.QwtScaleEngine
"""
if scaleDraw is None:
scaleDraw = FancyScaleDraw()
@@ -457,7 +491,8 @@ class DeltaTimeScaleDraw(FancyScaleDraw):
class FixedLabelsScaleEngine(qwt.QwtLinearScaleEngine):
def __init__(self, positions):
"""labels is a sequence of (pos,label) tuples where pos is the point
- at wich to draw the label and label is given as a python string (or QwtText)"""
+ at wich to draw the label and label is given as a python string (or QwtText)
+ """
qwt.QwtScaleEngine.__init__(self)
self._positions = positions
# self.setAttribute(self.Floating,True)
@@ -472,11 +507,14 @@ class FixedLabelsScaleEngine(qwt.QwtLinearScaleEngine):
"""convenience method that will enable this engine in the given
axis. Note that it changes the ScaleDraw as well.
- :param plot: (qwt.QwtPlot) the plot to change
- :param axis: (qwt.QwtPlot.Axis) the id of the axis
- :param scaleDraw: (qwt.QwtScaleDraw) Scale draw to use. If None given,
- the current ScaleDraw for the plot will be used if
- possible, and a :class:`FixedLabelsScaleDraw` will be set if not
+ :param plot: the plot to change
+ :type plot: qwt.QwtPlot
+ :param axis: the id of the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param scaleDraw: Scale draw to use. If None given, the current
+ ScaleDraw for the plot will be used if possible, and a
+ :class:`FixedLabelsScaleDraw` will be set if not
+ :type scaleDraw: qwt.QwtScaleDraw
"""
if scaleDraw is None:
scaleDraw = plot.axisScaleDraw(axis)
@@ -490,12 +528,16 @@ class FixedLabelsScaleEngine(qwt.QwtLinearScaleEngine):
"""convenience method that will disable this engine in the given
axis. Note that it changes the ScaleDraw as well.
- :param plot: (qwt.QwtPlot) the plot to change
- :param axis: (qwt.QwtPlot.Axis) the id of the axis
- :param scaleDraw: (qwt.QwtScaleDraw) Scale draw to use. If None given,
- a :class:`FancyScaleDraw` will be set
- :param scaleEngine: (qwt.QwtScaleEngine) Scale draw to use. If None given,
- a :class:`qwt.QwtLinearScaleEngine` will be set
+ :param plot: the plot to change
+ :type plot: qwt.QwtPlot
+ :param axis: the id of the axis
+ :type axis: qwt.QwtPlot.Axis
+ :param scaleDraw: Scale draw to use. If None given, a
+ :class:`FancyScaleDraw` will be set
+ :type scaleDraw: qwt.QwtScaleDraw
+ :param scaleEngine: Scale draw to use. If None given, a
+ :class:`qwt.QwtLinearScaleEngine` will be set
+ :type scaleEngine: qwt.QwtScaleEngine
"""
if scaleDraw is None:
scaleDraw = FancyScaleDraw()
@@ -510,7 +552,8 @@ class FixedLabelsScaleDraw(FancyScaleDraw):
"""This is a custom ScaleDraw that shows labels at given positions (and nowhere else)
positions is a sequence of points for which labels are defined.
labels is a sequence strings (or QwtText)
- Note that the lengths of positions and labels must match"""
+ Note that the lengths of positions and labels must match
+ """
if len(positions) != len(labels):
raise ValueError("lengths of positions and labels do not match")
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/styles.py b/lib/taurus/qt/qtgui/extra_guiqwt/styles.py
index deb91609..c87a2bca 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/styles.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/styles.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Extension of :mod:`guiqwt.styles`"""
+"""Extension of :mod:`guiqwt.styles`
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/taurustrend2d.py b/lib/taurus/qt/qtgui/extra_guiqwt/taurustrend2d.py
index 16cd2d75..96a3cade 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/taurustrend2d.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/taurustrend2d.py
@@ -71,14 +71,17 @@ class TaurusTrend2DDialog(ImageDialog, TaurusBaseWidget):
"""
:param param: param to be passed to XYImageItem constructor
- :param buffersize: (int) size of the stack
- :param stackMode: (str) can be 'datetime', 'timedelta' or 'event'
- :param autoscale: (str) if autscale string contains 'x', the x axis
- will be autoscaled. Same with 'y' and 'z'.
- Defaults to 'xyz'
+ :param buffersize: size of the stack
+ :type buffersize: int
+ :param stackMode: can be 'datetime', 'timedelta' or 'event'
+ :type stackMode: str
+ :param autoscale: if autscale string contains 'x', the x axis will be
+ autoscaled. Same with 'y' and 'z'. Defaults to 'xyz'
+ :type autoscale: str
"""
"""see :class:`guiqwt.plot.ImageDialog` for other valid initialization
- parameters"""
+ parameters
+ """
defaultOptions = dict(lock_aspect_ratio=False)
if options is not None:
defaultOptions.update(options)
@@ -186,7 +189,8 @@ class TaurusTrend2DDialog(ImageDialog, TaurusBaseWidget):
- as time deltas ('deltatime' or 'd')
- as event numbers ('event' or 'e')
- :param mode:(one of 'datetime', 'timedelta' or 'event')
+ :param mode:
+ :type mode: one of 'datetime', 'timedelta' or 'event'
"""
mode = str(mode)
if mode == "datetime":
@@ -267,8 +271,8 @@ class TaurusTrend2DDialog(ImageDialog, TaurusBaseWidget):
"""enables/disables looking up in the archiver for data stored before
the Trend was started
- :param enable: (bool) if True, archiving values will be used if
- available
+ :param enable: if True, archiving values will be used if available
+ :type enable: bool
"""
if not self._stackMode == "datetime":
self.info("ignoring setUseArchiving. Reason: not in X time scale")
@@ -277,7 +281,9 @@ class TaurusTrend2DDialog(ImageDialog, TaurusBaseWidget):
def getUseArchiving(self):
"""whether TaurusTrend is looking for data in the archiver when needed
- :return: (bool)
+ :return:
+ :rtype: bool
+
.. seealso:: :meth:`setUseArchiving`
"""
@@ -290,7 +296,9 @@ class TaurusTrend2DDialog(ImageDialog, TaurusBaseWidget):
def setMaxDataBufferSize(self, maxSize):
"""sets the maximum number of events that will be stacked
- :param maxSize: (int) the maximum limit
+ :param maxSize: the maximum limit
+ :type maxSize: int
+
.. seealso:: :class:`TaurusTrendSet`
"""
@@ -302,7 +310,8 @@ class TaurusTrend2DDialog(ImageDialog, TaurusBaseWidget):
def getMaxDataBufferSize(self):
"""returns the maximum number of events that can be plotted in the trend
- :return: (int)
+ :return:
+ :rtype: int
"""
return self.buffersize
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/tools.py b/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
index 58b92d38..c42fc513 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Extension of :mod:`guiqwt.tools`"""
+"""Extension of :mod:`guiqwt.tools`
+"""
__docformat__ = "restructuredtext"
@@ -249,7 +250,8 @@ class TimeAxisTool(CommandTool):
class AutoScrollTool(ToggleTool, BaseConfigurableClass):
"""A tool that puts the plot in "AutoScroll" mode.
This makes sense in trend plots where we want to keep the last value
- always visible"""
+ always visible
+ """
def __init__(self, manager, scrollFactor=0.2, toolbar_id=None):
ToggleTool.__init__(
diff --git a/lib/taurus/qt/qtgui/graphic/__init__.py b/lib/taurus/qt/qtgui/graphic/__init__.py
index a2381068..4fc3a360 100644
--- a/lib/taurus/qt/qtgui/graphic/__init__.py
+++ b/lib/taurus/qt/qtgui/graphic/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package contains a collection of taurus Qt graphics view widgets"""
+"""This package contains a collection of taurus Qt graphics view widgets
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/graphic/jdraw/__init__.py b/lib/taurus/qt/qtgui/graphic/jdraw/__init__.py
index 7f6a071c..5eca6882 100644
--- a/lib/taurus/qt/qtgui/graphic/jdraw/__init__.py
+++ b/lib/taurus/qt/qtgui/graphic/jdraw/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package contains the jdraw file format specific classes"""
+"""This package contains the jdraw file format specific classes
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/graphic/jdraw/jdraw.py b/lib/taurus/qt/qtgui/graphic/jdraw/jdraw.py
index 9df1b8ae..aab8986c 100644
--- a/lib/taurus/qt/qtgui/graphic/jdraw/jdraw.py
+++ b/lib/taurus/qt/qtgui/graphic/jdraw/jdraw.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the graphics factory for the jdraw file format"""
+"""This module contains the graphics factory for the jdraw file format
+"""
import os
import traceback
diff --git a/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_parser.py b/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_parser.py
index 3c95d567..44d7240e 100644
--- a/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_parser.py
+++ b/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_parser.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module parses jdraw files"""
+"""This module parses jdraw files
+"""
import os
import re
@@ -154,7 +155,8 @@ def p_jdfile_empty(p):
def p_global(p):
"""global : GLOBAL LBRACKET RBRACKET
- | GLOBAL LBRACKET parameter_list RBRACKET"""
+ | GLOBAL LBRACKET parameter_list RBRACKET
+ """
if len(p) == 4:
p[0] = {}
else:
@@ -176,7 +178,8 @@ def p_element(p):
def p_single_element(p):
"""element : obj LBRACKET RBRACKET
- | obj LBRACKET parameter_list RBRACKET"""
+ | obj LBRACKET parameter_list RBRACKET
+ """
# elems = None
if len(p) == 4:
@@ -241,7 +244,8 @@ def p_obj(p):
| JDIMAGE
| JDAXIS
| JDSLIDER
- | JDSPLINE"""
+ | JDSPLINE
+ """
p[0] = p[1]
@@ -270,7 +274,8 @@ def p_single_parameter(p):
def p_complex_parameter(p):
"""parameter : SYMBOL TWOP LBRACKET RBRACKET
| SYMBOL TWOP LBRACKET parameter_list RBRACKET
- | SYMBOL TWOP LBRACKET element_list RBRACKET"""
+ | SYMBOL TWOP LBRACKET element_list RBRACKET
+ """
if len(p) == 5:
p[4] = []
p[0] = {p[1]: p[4]}
@@ -308,7 +313,8 @@ def p_value_text(p):
def p_value_bool(p):
"""value : true
- | false"""
+ | false
+ """
p[0] = p[1] == "true"
diff --git a/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_view.py b/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_view.py
index 55cc763d..7889d87a 100644
--- a/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_view.py
+++ b/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_view.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains the graphics view widget for jdraw files"""
+"""This module contains the graphics view widget for jdraw files
+"""
import os
import traceback
diff --git a/lib/taurus/qt/qtgui/graphic/jdraw/test/res/__init__.py b/lib/taurus/qt/qtgui/graphic/jdraw/test/res/__init__.py
index ca809392..52eea2c4 100644
--- a/lib/taurus/qt/qtgui/graphic/jdraw/test/res/__init__.py
+++ b/lib/taurus/qt/qtgui/graphic/jdraw/test/res/__init__.py
@@ -30,5 +30,4 @@ This resources module contains:
scalars.
- styles.jdw : a jdraw synoptic for testing rendering of different styles
-
"""
diff --git a/lib/taurus/qt/qtgui/graphic/taurusgraphic.py b/lib/taurus/qt/qtgui/graphic/taurusgraphic.py
index 1908c388..1f5352b0 100644
--- a/lib/taurus/qt/qtgui/graphic/taurusgraphic.py
+++ b/lib/taurus/qt/qtgui/graphic/taurusgraphic.py
@@ -336,7 +336,8 @@ class TaurusGraphicsScene(Qt.QGraphicsScene):
def closeAllPanels(self):
"""This method replaces killProcess, using
- taurus.qt.qtgui.util.ExternalAppAction instead!"""
+ taurus.qt.qtgui.util.ExternalAppAction instead!
+ """
try:
self.debug(
"In closeAllPanels(%s,%s)" % (self.panel_launcher, self.panels)
@@ -383,8 +384,8 @@ class TaurusGraphicsScene(Qt.QGraphicsScene):
"""
Returns a list with all items matching a given name.
- :param strict: controls whether full_name (strict=True)
- or only device name (False) must match
+ :param strict: controls whether full_name (strict=True) or only device
+ name (False) must match
:type strict: bool or None
:return: items
@@ -424,7 +425,8 @@ class TaurusGraphicsScene(Qt.QGraphicsScene):
def getItemByPosition(self, x, y):
"""This method will try first with named objects;
- if failed then with itemAt"""
+ if failed then with itemAt
+ """
pos = Qt.QPointF(x, y)
itemsAtPos = []
for z, o in sorted(
@@ -503,7 +505,8 @@ class TaurusGraphicsScene(Qt.QGraphicsScene):
if mouseEvent.button() == Qt.Qt.RightButton:
"""This function is called when right clicking on
TaurusDevTree area. A pop up menu will be shown with the
- available options."""
+ available options.
+ """
self.debug("RightButton Mouse Event on %s" % (obj_name))
if isinstance(obj, TaurusGraphicsItem) and (
obj_name or obj.contextMenu() or obj.getExtensions()
@@ -961,7 +964,8 @@ class TaurusGraphicsScene(Qt.QGraphicsScene):
@staticmethod
def getTaurusParentItem(item, top=True):
"""Searches within a group hierarchy and returns a parent Taurus
- component or None if no parent TaurusBaseComponent is found."""
+ component or None if no parent TaurusBaseComponent is found.
+ """
if item is None:
return None
first, p = None, item.parentItem()
@@ -1023,7 +1027,8 @@ class TaurusGraphicsScene(Qt.QGraphicsScene):
class QGraphicsTextBoxing(Qt.QGraphicsItemGroup):
"""Display a text inside a virtual box. Support horizontal and vertical
- alignment"""
+ alignment
+ """
_TEXT_RATIO = 0.8
@@ -1204,7 +1209,8 @@ class TaurusGraphicsItem(TaurusBaseComponent):
def setContextMenu(self, menu):
"""Context Menu must be a list of tuples (ActionName,ActionMethod),
- empty tuples insert separators between options."""
+ empty tuples insert separators between options.
+ """
self._contextMenu = menu
def contextMenu(self):
@@ -1267,7 +1273,8 @@ class TaurusGraphicsItem(TaurusBaseComponent):
def getParentTaurusComponent(self):
"""Returns a parent Taurus component or None if no parent
- TaurusBaseComponent is found."""
+ TaurusBaseComponent is found.
+ """
p = self.parentItem()
while p and not isinstance(p, TaurusGraphicsItem):
p = self.parentItem()
@@ -1280,7 +1287,8 @@ class TaurusGraphicsItem(TaurusBaseComponent):
def updateStyle(self):
"""Method called when the component detects an event that triggers
- a change in the style."""
+ a change in the style.
+ """
if self.scene():
self.scene().updateSceneItem(self)
@@ -1792,5 +1800,6 @@ class TaurusBaseGraphicsFactory(object):
def set_common_params(self, item, params):
"""Sets the common parameters. Default implementation does nothing.
- Overwrite has necessary."""
+ Overwrite has necessary.
+ """
pass
diff --git a/lib/taurus/qt/qtgui/help/__init__.py b/lib/taurus/qt/qtgui/help/__init__.py
index ba0c340b..56bd0112 100644
--- a/lib/taurus/qt/qtgui/help/__init__.py
+++ b/lib/taurus/qt/qtgui/help/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""This package contains a collection of taurus Qt widgets that
-provide a way to browse through the application help system"""
+provide a way to browse through the application help system
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/help/aboutdialog.py b/lib/taurus/qt/qtgui/help/aboutdialog.py
index d37d83c7..bfcdcb94 100644
--- a/lib/taurus/qt/qtgui/help/aboutdialog.py
+++ b/lib/taurus/qt/qtgui/help/aboutdialog.py
@@ -47,8 +47,7 @@ Example usage::
pixmap = Qt.QIcon.fromTheme("folder-open").pixmap(64, 64)
about_dialog.setPixmap(pixmap)
about_dialog.exec_()
-
- """
+"""
__all__ = ["AboutDialog"]
@@ -82,7 +81,6 @@ class AboutDialog(Qt.QDialog):
pixmap = Qt.QIcon.fromTheme("folder-open").pixmap(64, 64)
about_dialog.setPixmap(pixmap)
about_dialog.exec_()
-
"""
_Template = (
diff --git a/lib/taurus/qt/qtgui/icon/catalog.py b/lib/taurus/qt/qtgui/icon/catalog.py
index 0a0e3b3e..01869bd4 100644
--- a/lib/taurus/qt/qtgui/icon/catalog.py
+++ b/lib/taurus/qt/qtgui/icon/catalog.py
@@ -102,7 +102,8 @@ class QIconCatalogPage(GraphicalChoiceWidget):
"""
Extracts md5 sum of a file
- :param fname: (str) path to file
+ :param fname: path to file
+ :type fname: str
:return: md5 hash
"""
hash_md5 = hashlib.md5()
diff --git a/lib/taurus/qt/qtgui/icon/icon.py b/lib/taurus/qt/qtgui/icon/icon.py
index b399c767..35758c1d 100644
--- a/lib/taurus/qt/qtgui/icon/icon.py
+++ b/lib/taurus/qt/qtgui/icon/icon.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides taurus-specific functions related to icons"""
+"""This module provides taurus-specific functions related to icons
+"""
__all__ = [
"sanitizePrefix",
@@ -168,7 +169,8 @@ def registerPathFiles(pathfilenames):
from the path files (prefix values will be sanitized first, and relative
path values will be made relative to the dir containing the .path file)
- :param pathfilenames: (list<str>) list of .path file names
+ :param pathfilenames: list of .path file names
+ :type pathfilenames: list<str>
"""
for filename in pathfilenames:
try:
@@ -191,10 +193,13 @@ def registerPathFiles(pathfilenames):
def registerTheme(name="Tango", path="", force=False):
"""Use bundled them if OS does not define a theme (non-X11 systems)
- :param name: (str) icon theme name (default=Tango)
- :param path: (str) path to dir containing the theme (absolute or relative
- to dir of taurus.qt.qtgui.icon). Default = ''
- :param force: (bool) Force to set path even if a theme is already set
+ :param name: icon theme name (default=Tango)
+ :type name: str
+ :param path: path to dir containing the theme (absolute or relative to dir
+ of taurus.qt.qtgui.icon). Default = ''
+ :type path: str
+ :param force: Force to set path even if a theme is already set
+ :type force: bool
"""
if force or not sys.platform.startswith("linux"):
base_dir = os.path.abspath(os.path.dirname(__file__))
@@ -209,11 +214,16 @@ def getCachedPixmap(key, size=None):
The key argument supports QDir's searchPath prefixes (see
:meth:`QDir.setSearchPaths`).
- :param key: (str) the pixmap key., e.g.: 'status:folder-open.svg'
- :param size: (int) the pixmap size in pixels (will get a square pixmap).
- If None is passed it will return the original size
+ :param key: the pixmap key., e.g.: 'status:folder-open.svg'
+ :type key: str
+ :param size: the pixmap size in pixels (will get a square pixmap). If None
+ is passed it will return the original size
+ :type size: int
- :return: (PyQt5.Qt.QPixmap)"""
+
+ :return:
+ :rtype: PyQt5.Qt.QPixmap
+ """
name = key
if size is not None:
@@ -234,12 +244,17 @@ def getStandardIcon(key, widget=None):
QStyle.StandardPixmap enumeration member. The widget argument is optional
and can also be used to aid the determination of the icon.
- :param key: (QStyle.StandardPixmap) a standard pixmap which can follow some
- existing GUI style or guideline
- :param widget: (Qt.QWidget) the widget argument (optional) can also be used
- to aid the determination of the icon.
+ :param key: a standard pixmap which can follow some existing GUI style or
+ guideline
+ :type key: QStyle.StandardPixmap
+ :param widget: the widget argument (optional) can also be used to aid the
+ determination of the icon.
+ :type widget: Qt.QWidget
- :return: (PyQt5.Qt.QIcon)"""
+
+ :return:
+ :rtype: PyQt5.Qt.QIcon
+ """
styleOption = None
if widget is not None:
styleOption = Qt.QStyleOption()
@@ -268,10 +283,14 @@ def getElementTypeIconName(elemType):
If an icon name cannot be found for elemType, None is returned.
- :param elemType: (TaurusElementType) the taurus element type
+ :param elemType: the taurus element type
+ :type elemType: TaurusElementType
- :return: (str) a string representing the icon name for the given
- :class:`taurus.core.taurusbasetypes.TaurusElementType`"""
+
+ :return: a string representing the icon name for the given
+ :class:`taurus.core.taurusbasetypes.TaurusElementType`
+ :rtype: str
+ """
if elemType is None:
return
data = _ELEM_TYPE_MAP.get(elemType)
@@ -287,10 +306,15 @@ def getElementTypeIcon(elemType, fallback=None):
If an icon cannot be found for the given TaurusElementType,
fallback is returned.
- :param elemType: (TaurusElementType) the taurus element type
- :param fallback: (PyQt5.Qt.QIcon) the fallback icon. Default is None.
+ :param elemType: the taurus element type
+ :type elemType: TaurusElementType
+ :param fallback: the fallback icon. Default is None.
+ :type fallback: PyQt5.Qt.QIcon
- :return: (PyQt5.Qt.QIcon)"""
+
+ :return:
+ :rtype: PyQt5.Qt.QIcon
+ """
themeIconName = getElementTypeIconName(elemType)
icon = Qt.QIcon.fromTheme(themeIconName)
@@ -303,11 +327,16 @@ def getElementTypePixmap(elemType, size=None):
"""Gets a PyQt5.Qt.QPixmap object for the given
:class:`taurus.core.taurusbasetypes.TaurusElementType`.
- :param elemType: (TaurusElementType) the taurus element type
- :param size: (int) the pixmap size in pixels (will get a square pixmap).
- Default is None meaning it will return the original size.
+ :param elemType: the taurus element type
+ :type elemType: TaurusElementType
+ :param size: the pixmap size in pixels (will get a square pixmap). Default
+ is None meaning it will return the original size.
+ :type size: int
+
- :return: (PyQt5.Qt.QPixmap or None)"""
+ :return:
+ :rtype: PyQt5.Qt.QPixmap or None
+ """
if elemType is None:
return
@@ -331,10 +360,15 @@ def getDevStateIcon(state, fallback=None):
If an icon cannot be found for the given state, fallback is returned.
- :param state: (TaurusDevState) the taurus device state
- :param fallback: (PyQt5.Qt.QIcon) the fallback icon. Default is None.
+ :param state: the taurus device state
+ :type state: TaurusDevState
+ :param fallback: the fallback icon. Default is None.
+ :type fallback: PyQt5.Qt.QIcon
- :return: (PyQt5.Qt.QIcon or None)"""
+
+ :return:
+ :rtype: PyQt5.Qt.QIcon or None
+ """
if state is None:
return
data = _STATE_MAP.get(state)
@@ -352,11 +386,15 @@ def getDevStatePixmap(state, size=None):
"""Gets a PyQt5.Qt.QPixmap object for the given
:class:`taurus.core.taurusbasetypes.TaurusDevState`.
- :param state: (TaurusDevState) the taurus software device state
- :param size: (int) the pixmap size in pixels (will get a square pixmap).
- Default is None meaning it will return the original size.
+ :param state: the taurus software device state
+ :type state: TaurusDevState
+ :param size: the pixmap size in pixels (will get a square pixmap). Default
+ is None meaning it will return the original size.
+ :type size: int
+
- :return: (PyQt5.Qt.QPixmap or None)
+ :return:
+ :rtype: PyQt5.Qt.QPixmap or None
"""
if state is None:
return None
diff --git a/lib/taurus/qt/qtgui/input/__init__.py b/lib/taurus/qt/qtgui/input/__init__.py
index 2b7c05bb..4160cf1f 100644
--- a/lib/taurus/qt/qtgui/input/__init__.py
+++ b/lib/taurus/qt/qtgui/input/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""This package contains a collection of taurus Qt widgets that typically interact
-with the user. Examples are line edits, comboboxes and checkboxes"""
+with the user. Examples are line edits, comboboxes and checkboxes
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/input/choicedlg.py b/lib/taurus/qt/qtgui/input/choicedlg.py
index ac5a4225..4beb4fbe 100644
--- a/lib/taurus/qt/qtgui/input/choicedlg.py
+++ b/lib/taurus/qt/qtgui/input/choicedlg.py
@@ -23,7 +23,8 @@
##
###########################################################################
-"""This package provides a dialog for graphically choosing a Taurus class"""
+"""This package provides a dialog for graphically choosing a Taurus class
+"""
from taurus.external.qt import Qt
@@ -92,7 +93,8 @@ class GraphicalChoiceDlg(Qt.QDialog):
def getChosen(self):
"""
returns the choice
- :return: (str)
+ :return:
+ :rtype: str
"""
return self._iconsArea.getChosen()
@@ -112,27 +114,38 @@ class GraphicalChoiceDlg(Qt.QDialog):
Static method which launches a GraphicalChoiceDlg with the given options
and returns the result
- :param parent: (QWidget) The parent of the dialog (it will be centered on it)
- :param title: (str) the text which is displayed in the title bar of the dialog
- :param msg: (str) the text which is shown to the user in the dialog,
- above the choices.
- :param choices: (list<list>) a list of lists of strings to be used as
- choices names. The (possibly sparse) 2D array defined by
- the nested lists will be used to present the choices in
- a grid. The choice names will be used as keys for pixmaps
- :param pixmaps: (dict<str,QPixmap>) dictionary mapping the choices text to
- corresponding pixmap. If no valid pixmap is provided for
- a given choice, the defaultPixmap will be used
- :param iconSize: (int) size of the icons to be displayed (128px by default)
- :param defaultPixmap: (QPixmap) Default Pixmap to use if none passed for a
- given choice. No Pixmap will be used if None passed.
- :param horizontalScrollBarPolicy: (enum Qt.ScrollBarPolicy) defines the mode of the horizontal scroll bar.
- The default mode is ScrollBarAsNeeded.
- :param verticalScrollBarPolicy: (enum Qt.ScrollBarPolicy) defines the mode of the vertical scroll bar.
- The default mode is ScrollBarAsNeeded
- :return: (tuple<str,bool>) A tuple containing choice,ok. choice is the name of
- the chosen option. ok is true if the user pressed OK and false
- if the user pressed Cancel.
+ :param parent: The parent of the dialog (it will be centered on it)
+ :type parent: QWidget
+ :param title: the text which is displayed in the title bar of the
+ dialog
+ :type title: str
+ :param msg: the text which is shown to the user in the dialog, above
+ the choices.
+ :type msg: str
+ :param choices: a list of lists of strings to be used as choices names.
+ The (possibly sparse) 2D array defined by the nested lists will be
+ used to present the choices in a grid. The choice names will be
+ used as keys for pixmaps
+ :type choices: list<list>
+ :param pixmaps: dictionary mapping the choices text to corresponding
+ pixmap. If no valid pixmap is provided for a given choice, the
+ defaultPixmap will be used
+ :type pixmaps: dict<str,QPixmap>
+ :param iconSize: size of the icons to be displayed (128px by default)
+ :type iconSize: int
+ :param defaultPixmap: Default Pixmap to use if none passed for a given
+ choice. No Pixmap will be used if None passed.
+ :type defaultPixmap: QPixmap
+ :param horizontalScrollBarPolicy: defines the mode of the horizontal
+ scroll bar. The default mode is ScrollBarAsNeeded.
+ :type horizontalScrollBarPolicy: enum Qt.ScrollBarPolicy
+ :param verticalScrollBarPolicy: defines the mode of the vertical scroll
+ bar. The default mode is ScrollBarAsNeeded
+ :type verticalScrollBarPolicy: enum Qt.ScrollBarPolicy
+ :return: A tuple containing choice,ok. choice is the name of the chosen
+ option. ok is true if the user pressed OK and false if the user
+ pressed Cancel.
+ :rtype: tuple<str,bool>
"""
dlg = GraphicalChoiceDlg(
parent=parent,
@@ -198,13 +211,15 @@ class GraphicalChoiceWidget(Qt.QScrollArea):
"""
sets the available options
- :param choices: (list<list>) a list of lists of strings to be used as
- choices names. The (possibly sparse) 2D array defined by
- the nested lists will be used to present the choices in
- a grid. The choice names will be used as keys for pixmaps
- :param pixmaps: (dict<str,QPixmap>) dictionary mapping the choices text to
- corresponding pixmap. If no valid pixmap is provided for
- a given choice, a default pixmap will be used
+ :param choices: a list of lists of strings to be used as choices names.
+ The (possibly sparse) 2D array defined by the nested lists will be
+ used to present the choices in a grid. The choice names will be
+ used as keys for pixmaps
+ :type choices: list<list>
+ :param pixmaps: dictionary mapping the choices text to corresponding
+ pixmap. If no valid pixmap is provided for a given choice, a
+ default pixmap will be used
+ :type pixmaps: dict<str,QPixmap>
"""
if pixmaps is None:
pixmaps = {}
@@ -218,12 +233,18 @@ class GraphicalChoiceWidget(Qt.QScrollArea):
"""
sets the option for a given row,column coordinate in the grid
- :param row: (int) row in the grid for this option
- :param col: (int) column in the grid for this option
- :param text: (str) name for this option
- :param pixmap: (QPixmap or None) If no valid pixmap is provided for
- a given choice, the default one will be used
- :param tooltip: (str) tooltip for this option (if None given, the `text` is used)
+ :param row: row in the grid for this option
+ :type row: int
+ :param col: column in the grid for this option
+ :type col: int
+ :param text: name for this option
+ :type text: str
+ :param pixmap: If no valid pixmap is provided for a given choice, the
+ default one will be used
+ :type pixmap: QPixmap or None
+ :param tooltip: tooltip for this option (if None given, the `text` is
+ used)
+ :type tooltip: str
"""
if not pixmap or pixmap is None or pixmap.isNull():
pixmap = self._defaultPixmap
@@ -255,7 +276,8 @@ class GraphicalChoiceWidget(Qt.QScrollArea):
def getChosen(self):
"""
returns the choice
- :return: (str)
+ :return:
+ :rtype: str
"""
return self._chosen
@@ -276,7 +298,9 @@ class GraphicalChoiceWidget(Qt.QScrollArea):
'icon' : 'logos:taurus.png',
'container' : False }
- :return: (dict) a map with pertinent designer information"""
+ :return: a map with pertinent designer information
+ :rtype: dict
+ """
return {
"module": "taurus.qt.qtgui.input",
"group": "Taurus Input",
diff --git a/lib/taurus/qt/qtgui/input/qwheel.py b/lib/taurus/qt/qtgui/input/qwheel.py
index 3da3ded3..06063393 100644
--- a/lib/taurus/qt/qtgui/input/qwheel.py
+++ b/lib/taurus/qt/qtgui/input/qwheel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides an arrow based widget."""
+"""This module provides an arrow based widget.
+"""
import os
import math
@@ -179,7 +180,8 @@ class _DigitLabel(Qt.QLabel):
class QWheelEdit(Qt.QFrame):
"""A widget designed to handle numeric scalar values. It allows interaction
- based on single digit as well as normal value edition."""
+ based on single digit as well as normal value edition.
+ """
numberChanged = Qt.pyqtSignal(float)
numberEdited = Qt.pyqtSignal(float)
@@ -251,7 +253,8 @@ class QWheelEdit(Qt.QFrame):
def _build(self):
"""_build(self) -> None
- Builds this widget sub-items"""
+ Builds this widget sub-items
+ """
l = self.layout()
l.setSpacing(0)
@@ -352,7 +355,8 @@ class QWheelEdit(Qt.QFrame):
def _clear(self):
"""_clear(self) -> None
- Clears this widget sub-items"""
+ Clears this widget sub-items
+ """
self._upButtons.buttonClicked.disconnect(self.buttonPressed)
self._downButtons.buttonClicked.disconnect(self.buttonPressed)
diff --git a/lib/taurus/qt/qtgui/input/tauruscheckbox.py b/lib/taurus/qt/qtgui/input/tauruscheckbox.py
index ec005fcb..d00e4bcb 100644
--- a/lib/taurus/qt/qtgui/input/tauruscheckbox.py
+++ b/lib/taurus/qt/qtgui/input/tauruscheckbox.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a set of basic taurus widgets based on QCheckBox"""
+"""This module provides a set of basic taurus widgets based on QCheckBox
+"""
__all__ = ["TaurusValueCheckBox"]
diff --git a/lib/taurus/qt/qtgui/input/tauruscombobox.py b/lib/taurus/qt/qtgui/input/tauruscombobox.py
index dae45bc9..16eab28d 100644
--- a/lib/taurus/qt/qtgui/input/tauruscombobox.py
+++ b/lib/taurus/qt/qtgui/input/tauruscombobox.py
@@ -24,7 +24,8 @@
##
#############################################################################
-"""This module provides a set of basic taurus widgets based on QCheckBox"""
+"""This module provides a set of basic taurus widgets based on QCheckBox
+"""
__all__ = ["TaurusAttrListComboBox", "TaurusValueComboBox"]
@@ -41,7 +42,8 @@ import numpy
class TaurusValueComboBox(Qt.QComboBox, TaurusBaseWritableWidget):
"""This widget shows a combobox that offers a limited choice of values that
- can be set on an attribute."""
+ can be set on an attribute.
+ """
def __init__(self, parent=None, designMode=False):
self._previousModelName = None
@@ -181,8 +183,9 @@ class TaurusValueComboBox(Qt.QComboBox, TaurusBaseWritableWidget):
Sets the correspondence between the values to be applied and their
associated text to show in the combobox.
- :param names: (sequence<tuple>) A sequence of (name,value) tuples,
- where each attribute value gets a name for display
+ :param names: A sequence of (name,value) tuples, where each attribute
+ value gets a name for display
+ :type names: sequence<tuple>
"""
bs = self.blockSignals(True)
self.clear()
@@ -195,8 +198,9 @@ class TaurusValueComboBox(Qt.QComboBox, TaurusBaseWritableWidget):
... seealso: :meth:`setValueNames`
- :param names: (sequence<tuple>) A sequence of (name,value) tuples,
- where each attribute value gets a name for display
+ :param names: A sequence of (name,value) tuples, where each attribute
+ value gets a name for display
+ :type names: sequence<tuple>
"""
bs = self.blockSignals(True)
try:
@@ -218,9 +222,10 @@ class TaurusValueComboBox(Qt.QComboBox, TaurusBaseWritableWidget):
(or a default value if not found).
:param value: value to look up
- :param default: (str) value in case it is not found. It accepts
- a '%s' placeholder which will be substituted with
- str(value). It defaults to 'UNKNOWN(%s)'.
+ :param default: value in case it is not found. It accepts a '%s'
+ placeholder which will be substituted with str(value). It defaults
+ to 'UNKNOWN(%s)'.
+ :type default: str
"""
item = self.findData(value)
if item < 0:
@@ -424,7 +429,8 @@ def _taurusAttrListTest():
def _taurusValueComboboxTest():
from taurus.qt.qtgui.application import TaurusApplication
- """tests TaurusValueCombobox """
+ """tests TaurusValueCombobox
+ """
# model = sys.argv[1]
names = [("name0", 0), ("name1", 1), ("name2", 2), ("name3", 3)]
diff --git a/lib/taurus/qt/qtgui/input/tauruslineedit.py b/lib/taurus/qt/qtgui/input/tauruslineedit.py
index 2ed83bcc..834fe37c 100644
--- a/lib/taurus/qt/qtgui/input/tauruslineedit.py
+++ b/lib/taurus/qt/qtgui/input/tauruslineedit.py
@@ -62,7 +62,6 @@ class TaurusValueLineEdit(Qt.QLineEdit, TaurusBaseWritableWidget):
when used with models whose value is a pint `Quantity`, the text
is parsed by pint and therefore one can write e.g. `2 3 mm` which is
equivalent to `6 mm` !
-
"""
_bytesEncoding = sys.stdin.encoding
@@ -114,7 +113,8 @@ class TaurusValueLineEdit(Qt.QLineEdit, TaurusBaseWritableWidget):
def __decimalDigits(self, fmt):
"""returns the number of decimal digits from a format string
- (or None if they are not defined)"""
+ (or None if they are not defined)
+ """
try:
if fmt[-1].lower() in ["f", "g"] and "." in fmt:
return int(fmt[:-1].split(".")[-1])
@@ -173,8 +173,9 @@ class TaurusValueLineEdit(Qt.QLineEdit, TaurusBaseWritableWidget):
"""
Validates current text
- :return: (bool) Returns False if there is a validator and the current
- text is not Acceptable. Returns True otherwise.
+ :return: Returns False if there is a validator and the current text is
+ not Acceptable. Returns True otherwise.
+ :rtype: bool
"""
val = self.validator()
if val is None:
diff --git a/lib/taurus/qt/qtgui/input/taurusspinbox.py b/lib/taurus/qt/qtgui/input/taurusspinbox.py
index 82d35aa7..830caf53 100644
--- a/lib/taurus/qt/qtgui/input/taurusspinbox.py
+++ b/lib/taurus/qt/qtgui/input/taurusspinbox.py
@@ -164,8 +164,8 @@ class TaurusValueSpinBox(Qt.QAbstractSpinBox):
def _getSingleStepQuantity(self):
"""
- :return: (Quantity) returns a single step with the units of the current
- value
+ :return: returns a single step with the units of the current value
+ :rtype: Quantity
"""
value = self.getValue()
if value is None:
diff --git a/lib/taurus/qt/qtgui/input/tauruswheel.py b/lib/taurus/qt/qtgui/input/tauruswheel.py
index 8839a65f..0beaa9ce 100644
--- a/lib/taurus/qt/qtgui/input/tauruswheel.py
+++ b/lib/taurus/qt/qtgui/input/tauruswheel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a set of basic taurus widgets based on QWheelEdit"""
+"""This module provides a set of basic taurus widgets based on QWheelEdit
+"""
from taurus.external.qt import Qt
diff --git a/lib/taurus/qt/qtgui/model/__init__.py b/lib/taurus/qt/qtgui/model/__init__.py
index 15ccb124..19c69455 100644
--- a/lib/taurus/qt/qtgui/model/__init__.py
+++ b/lib/taurus/qt/qtgui/model/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package provides the set of base model widget classes."""
+"""This package provides the set of base model widget classes.
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/model/qbasemodel.py b/lib/taurus/qt/qtgui/model/qbasemodel.py
index b89eb8ef..f6581245 100644
--- a/lib/taurus/qt/qtgui/model/qbasemodel.py
+++ b/lib/taurus/qt/qtgui/model/qbasemodel.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides base widget that displays a Qt view widget envolved
-by a toolbar and a status bar (optional)"""
+by a toolbar and a status bar (optional)
+"""
__all__ = [
"QBaseModelWidget",
@@ -114,7 +115,8 @@ class FilterToolBar(BaseToolBar):
class EditorToolBar(BaseToolBar):
"""Internal widget to be placed in a _QToolArea providing buttons for
- moving, adding and removing items from a view based widget"""
+ moving, adding and removing items from a view based widget
+ """
addTriggered = Qt.pyqtSignal()
removeTriggered = Qt.pyqtSignal()
@@ -312,7 +314,8 @@ class PerspectiveToolBar(BaseToolBar):
def switchPerspectiveButton(self):
"""Returns the QToolButton that handles the switch perspective.
- :return: (PyQt5.Qt.QToolButton) the switch perspective tool button
+ :return: the switch perspective tool button
+ :rtype: PyQt5.Qt.QToolButton
"""
return self._perspective_button
@@ -330,7 +333,8 @@ class QBaseModelWidget(Qt.QMainWindow):
"""A pure Qt widget designed to display a Qt view widget (QTreeView for
example), envolved by optional toolbar and statusbar.
The Qt model associated with the internal Qt view widget should be a
- :class:`taurus.qt.qtcore.model.TaurusBaseModel`"""
+ :class:`taurus.qt.qtcore.model.TaurusBaseModel`
+ """
KnownPerspectives = {}
DftPerspective = None
@@ -470,13 +474,15 @@ class QBaseModelWidget(Qt.QMainWindow):
def _onClicked(self, index):
"""Emits an "itemClicked" signal with with the clicked item and column
- as arguments"""
+ as arguments
+ """
item = self._mapToSource(index).internalPointer()
self.itemClicked.emit(item, index.column())
def _onDoubleClicked(self, index):
"""Emits an "itemDoubleClicked" signal with the clicked item and column
- as arguments"""
+ as arguments
+ """
item = self._mapToSource(index).internalPointer()
self.itemDoubleClicked.emit(item, index.column())
@@ -559,7 +565,8 @@ class QBaseModelWidget(Qt.QMainWindow):
def selectedItems(self):
"""Returns a list of all selected non-hidden items
- :return: (list<TaurusTreeItem>)
+ :return:
+ :rtype: list<TaurusTreeItem>
"""
view = self.viewWidget()
return [
@@ -642,7 +649,8 @@ class QBaseModelWidget(Qt.QMainWindow):
class TaurusBaseModelWidget(TaurusBaseWidget):
"""A class:`taurus.qt.qtgui.base.TaurusBaseWidget` that connects to a
taurus model. It must be used together with
- class:`~taurus.qt.qtgui.base.QBaseModelWidget`"""
+ class:`~taurus.qt.qtgui.base.QBaseModelWidget`
+ """
def __init__(self, designMode=False): # , perspective=None, proxy=None):
name = self.__class__.__name__
diff --git a/lib/taurus/qt/qtgui/panel/__init__.py b/lib/taurus/qt/qtgui/panel/__init__.py
index 5801aad4..20513295 100644
--- a/lib/taurus/qt/qtgui/panel/__init__.py
+++ b/lib/taurus/qt/qtgui/panel/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""This package contains a collection of taurus Qt widgets representing various
-panels like forms or panels to be inserted in dialogs"""
+panels like forms or panels to be inserted in dialogs
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/panel/qdataexportdialog.py b/lib/taurus/qt/qtgui/panel/qdataexportdialog.py
index 151d1eca..97bff8d4 100644
--- a/lib/taurus/qt/qtgui/panel/qdataexportdialog.py
+++ b/lib/taurus/qt/qtgui/panel/qdataexportdialog.py
@@ -24,7 +24,8 @@
#############################################################################
"""DataExportDlg.py: A Qt dialog for showing and exporting x-y Ascii data from
-one or more curves"""
+one or more curves
+"""
import os.path
from datetime import datetime
@@ -47,7 +48,8 @@ class QDataExportDialog(Qt.QDialog):
where name is the curve name and
x,y are iterable containers (e.g., lists, tuple, arrays...) of data to be exported
- @TODO: It would be nice if the textedit scrolled to the start ***also for the first set loaded***"""
+ @TODO: It would be nice if the textedit scrolled to the start ***also for the first set loaded***
+ """
# constants
allInSingleFile = "All sets in a single file (table like)"
@@ -97,7 +99,6 @@ class QDataExportDialog(Qt.QDialog):
ofile: output file name or file handle. It will prompt if not provided
verbose: set this to False to disable information popups
AllowCloseAfter: set this to false if you want to ignore the checkbox in the dialog
-
"""
if set is None:
set = str(self.dataSetCB.currentText())
@@ -157,7 +158,8 @@ class QDataExportDialog(Qt.QDialog):
def exportAllData(self, preffix=None):
"""Exports all sets using a common preffix and appending 'XXX.dat', where XXX is a number starting at 001
- if preffix is not given, the user is prompted for a directory path"""
+ if preffix is not given, the user is prompted for a directory path
+ """
if preffix is None:
outputdir = Qt.QFileDialog.getExistingDirectory(
self, "Export Directory", ""
diff --git a/lib/taurus/qt/qtgui/panel/qdoublelist.py b/lib/taurus/qt/qtgui/panel/qdoublelist.py
index ac2e7c8b..9b732680 100644
--- a/lib/taurus/qt/qtgui/panel/qdoublelist.py
+++ b/lib/taurus/qt/qtgui/panel/qdoublelist.py
@@ -85,7 +85,8 @@ class QDoubleListDlg(Qt.QDialog):
def setList1(self, list1):
"""sets the items to be present in the first list
- :param list2: (seq<str>) a sequence of strings
+ :param list2: a sequence of strings
+ :type list2: seq<str>
"""
self.ui.list1.clear()
self.ui.list1.addItems(list1)
@@ -93,7 +94,8 @@ class QDoubleListDlg(Qt.QDialog):
def setList2(self, list2):
"""sets the items to be present in the second list
- :param list2: (seq<str>) a sequence of strings
+ :param list2: a sequence of strings
+ :type list2: seq<str>
"""
self.ui.list2.clear()
self.ui.list2.addItems(list2)
@@ -109,7 +111,8 @@ class QDoubleListDlg(Qt.QDialog):
def getAll1(self):
"""returns a copy the items in the first list
- :return: (list<str>)
+ :return:
+ :rtype: list<str>
"""
return [
str(self.ui.list1.item(row).text())
@@ -119,7 +122,8 @@ class QDoubleListDlg(Qt.QDialog):
def getAll2(self):
"""returns a copy the items in the second list
- :return: (list<str>)
+ :return:
+ :rtype: list<str>
"""
return [
str(self.ui.list2.item(row).text())
diff --git a/lib/taurus/qt/qtgui/panel/qrawdatachooser.py b/lib/taurus/qt/qtgui/panel/qrawdatachooser.py
index becde284..22263273 100644
--- a/lib/taurus/qt/qtgui/panel/qrawdatachooser.py
+++ b/lib/taurus/qt/qtgui/panel/qrawdatachooser.py
@@ -65,7 +65,8 @@ class QRawDataWidget(Qt.QWidget):
def onAddCurveButtonClicked(self):
"""Emit a AddCurve signal with a rawdata dictionary as a parameter.
- The rawdata dictionary is prepared from the from the GUI's selection."""
+ The rawdata dictionary is prepared from the from the GUI's selection.
+ """
rawdata = {}
if self.xRangeRB.isChecked():
rawdata["x"] = numpy.arange(
diff --git a/lib/taurus/qt/qtgui/panel/report/albareport.py b/lib/taurus/qt/qtgui/panel/report/albareport.py
index 87ab5a0b..ac6f029e 100644
--- a/lib/taurus/qt/qtgui/panel/report/albareport.py
+++ b/lib/taurus/qt/qtgui/panel/report/albareport.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Provides an ALBA-customized SendMailDialog to create tickets in ALBA"""
+"""Provides an ALBA-customized SendMailDialog to create tickets in ALBA
+"""
# TODO: replace this module by a site-agnostic configurable alternative
# see https://gitlab.com/taurus-org/taurus/-/issues/811
diff --git a/lib/taurus/qt/qtgui/panel/report/basicreport.py b/lib/taurus/qt/qtgui/panel/report/basicreport.py
index 3a54a3a5..94205d2e 100644
--- a/lib/taurus/qt/qtgui/panel/report/basicreport.py
+++ b/lib/taurus/qt/qtgui/panel/report/basicreport.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a panel to display taurus messages"""
+"""This module provides a panel to display taurus messages
+"""
__all__ = ["ClipboardReportHandler", "SMTPReportHandler"]
diff --git a/lib/taurus/qt/qtgui/panel/taurusconfigeditor.py b/lib/taurus/qt/qtgui/panel/taurusconfigeditor.py
index 5f209984..8ca35739 100644
--- a/lib/taurus/qt/qtgui/panel/taurusconfigeditor.py
+++ b/lib/taurus/qt/qtgui/panel/taurusconfigeditor.py
@@ -80,7 +80,8 @@ class QConfigEditorModel(Qt.QStandardItemModel):
Loads file with setting, creates temporary settings file, where changes
made to configuration are saved.
- :param iniFileName: (str)
+ :param iniFileName:
+ :type iniFileName: str
"""
self.originalFile = iniFileName
self._temporaryFile = tempfile.NamedTemporaryFile(delete=False).name
@@ -128,12 +129,16 @@ class QConfigEditorModel(Qt.QStandardItemModel):
next key (from the path) until reaches element to be deleted. After the
element is deleted, returns updated dictionary.
- :param dict: (dict) a taurus configuration dictionary. See
- :class:`BaseConfigurableClass`
- :param path: (str) a semicolon-separated string containing the
- path of the branch in the tree
+ :param dict: a taurus configuration dictionary. See
+ :class:`BaseConfigurableClass`
+ :type dict: dict
+ :param path: a semicolon-separated string containing the path of the
+ branch in the tree
+ :type path: str
- :returns: (dict) the modified config dict
+
+ :return: the modified config dict
+ :rtype: dict
"""
val = str(path).split(";", 1)
if len(val) == 2:
@@ -168,8 +173,10 @@ class QConfigEditorModel(Qt.QStandardItemModel):
dictionary. Invoked by :meth:`Qt.QAbstractTableModel.setData`, when user
make changes to the value in the settings tree.
- :param value: (str) the new value (a string that will be python-evaluated)
- :param index: (QModelIndex) index of the model
+ :param value: the new value (a string that will be python-evaluated)
+ :type value: str
+ :param index: index of the model
+ :type index: QModelIndex
"""
changedItem = self.itemFromIndex(index)
path = changedItem.data(Qt.Qt.UserRole)
@@ -206,12 +213,17 @@ class QConfigEditorModel(Qt.QStandardItemModel):
key (from the path) until reaches element to be modified. After the
element is modified, returns updated dictionary.
- :param cdict: a configuration dictionary. See :class:`BaseConfigurableClass`
- :param path: (str) a semicolon-separated string containing the
- path of the branch in the tree
- :param value: (str) the new value (a string that will be python-evaluated)
+ :param cdict: a configuration dictionary. See
+ :class:`BaseConfigurableClass`
+ :param path: a semicolon-separated string containing the path of the
+ branch in the tree
+ :type path: str
+ :param value: the new value (a string that will be python-evaluated)
+ :type value: str
+
- :returns: (dict) the modified config dict
+ :return: the modified config dict
+ :rtype: dict
"""
val = str(path).split(";", 1)
if len(val) == 2:
@@ -232,7 +244,9 @@ class QConfigEditorModel(Qt.QStandardItemModel):
This metod creates top nodes only (names of the perspectives, main
window) and invokes fillTaurusConfig. Returns complete dictionary.
- :returns: (dict) a configuration dictionary. See :class:`BaseConfigurableClass`
+ :return: a configuration dictionary. See
+ :class:`BaseConfigurableClass`
+ :rtype: dict
"""
# self.tree.clear()
root = self.invisibleRootItem()
@@ -269,8 +283,11 @@ class QConfigEditorModel(Qt.QStandardItemModel):
"""
Fills the non-top nodes of the dictionary recursively.
- :param item: (Qt.QStandardItem) parent item
- :param configdict: (dict) a configuration dictionary. See :class:`BaseConfigurableClass`
+ :param item: parent item
+ :type item: Qt.QStandardItem
+ :param configdict: a configuration dictionary. See
+ :class:`BaseConfigurableClass`
+ :type configdict: dict
"""
if not BaseConfigurableClass.isTaurusConfig(configdict):
return
@@ -358,7 +375,9 @@ class QConfigEditorModel(Qt.QStandardItemModel):
Loads and returns the configuration dictionary from the settings file
using pickle module.
- :param key: (str)
+ :param key:
+ :type key: str
+
:returns (dict)
"""
@@ -393,8 +412,9 @@ class QConfigEditorModel(Qt.QStandardItemModel):
def saveSettings(self, group=None):
"""Saves the current state to the temporary file
- :param group: (str) a prefix that will be added to the keys to be
- saved (no prefix by default)
+ :param group: a prefix that will be added to the keys to be saved (no
+ prefix by default)
+ :type group: str
"""
if group is not None:
self._settings.beginGroup(group)
@@ -437,7 +457,8 @@ class QConfigEditorModel(Qt.QStandardItemModel):
class QConfigEditor(TaurusWidget):
"""A widget that shows a tree view of the contents of Taurus
configuration files saved by TaurusMainWindow and lets the user edit
- the values of the configuration keys"""
+ the values of the configuration keys
+ """
def __init__(self, parent=None, designMode=False):
TaurusWidget.__init__(self, parent=parent, designMode=designMode)
diff --git a/lib/taurus/qt/qtgui/panel/taurusconfigurationpanel.py b/lib/taurus/qt/qtgui/panel/taurusconfigurationpanel.py
index 986d9692..9b214581 100644
--- a/lib/taurus/qt/qtgui/panel/taurusconfigurationpanel.py
+++ b/lib/taurus/qt/qtgui/panel/taurusconfigurationpanel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a set of basic taurus widgets based on QLineEdit"""
+"""This module provides a set of basic taurus widgets based on QLineEdit
+"""
__all__ = [
"TaurusConfigurationPanel",
diff --git a/lib/taurus/qt/qtgui/panel/taurusdevicepanel.py b/lib/taurus/qt/qtgui/panel/taurusdevicepanel.py
index 92d8bede..5fbc12a3 100644
--- a/lib/taurus/qt/qtgui/panel/taurusdevicepanel.py
+++ b/lib/taurus/qt/qtgui/panel/taurusdevicepanel.py
@@ -197,7 +197,6 @@ class TaurusDevicePanel(TaurusWidget):
('onhv1',()), ('offhv1',()), ('onhv2',()), ('offhv2',()),
('sendcommand',())
),}
-
"""
klass._command_filter.update(filters)
diff --git a/lib/taurus/qt/qtgui/panel/taurusform.py b/lib/taurus/qt/qtgui/panel/taurusform.py
index a0033ef2..c9c1e02b 100644
--- a/lib/taurus/qt/qtgui/panel/taurusform.py
+++ b/lib/taurus/qt/qtgui/panel/taurusform.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains taurus Qt form widgets"""
+"""This module contains taurus Qt form widgets
+"""
import click
from datetime import datetime
@@ -105,7 +106,8 @@ class TaurusForm(TaurusWidget):
By default, the form provides global Apply and Cancel buttons.
You can also see some code that exemplifies the use of TaurusForm in :ref:`Taurus
- coding examples <examples>`"""
+ coding examples <examples>`
+ """
def __init__(
self,
@@ -231,15 +233,17 @@ class TaurusForm(TaurusWidget):
The default values for the include and exclude arguments are defined
in `tauruscustomsettings.T_FORM_ITEM_FACTORIES`
- :param include: (tuple). The members in the tuple can be: Regexp
- patterns (in string or compiled form) matching the
- names to be included in the selection. They can also be
- item factory functions (which then are wrapped in an
- EntryPoint-like object and included in the selection).
- :param exclude: (tuple). Regexp patterns ( either `str` or
- :class:`re.Pattern` objects) matching registered names
- to be excluded.
- :return: (list) selected item factories entry points
+ :param include: The members in the tuple can be: Regexp patterns (in
+ string or compiled form) matching the names to be included in the
+ selection. They can also be item factory functions (which then are
+ wrapped in an EntryPoint-like object and included in the
+ selection).
+ :type include: tuple
+ :param exclude: Regexp patterns ( either `str` or :class:`re.Pattern`
+ objects) matching registered names to be excluded.
+ :type exclude: tuple
+ :return: selected item factories entry points
+ :rtype: list
"""
patterns = getattr(_ts, "T_FORM_ITEM_FACTORIES", {})
if include is None:
@@ -258,9 +262,8 @@ class TaurusForm(TaurusWidget):
returns the list of item factories entry points currently in use
:param return_disabled: If False (default), it returns only a list of
- the enabled factories. If True, it returns a
- tuple containing two lists: the enabled and
- the available but disabled factories.
+ the enabled factories. If True, it returns a tuple containing two
+ lists: the enabled and the available but disabled factories.
"""
enabled = self._itemFactories
if return_disabled:
@@ -276,6 +279,7 @@ class TaurusForm(TaurusWidget):
:param model: taurus model object
+
:return: custom TaurusValue class
"""
try:
@@ -301,9 +305,10 @@ class TaurusForm(TaurusWidget):
def setCustomWidgetMap(self, cwmap):
"""Sets a map map for custom widgets.
- :param cwmap: (dict<str,tuple>) a dictionary whose keys are device
- type strings (i.e. see :class:`PyTango.DeviceInfo`) and
- whose values are tuples of classname,args,kwargs
+ :param cwmap: a dictionary whose keys are device type strings (i.e. see
+ :class:`PyTango.DeviceInfo`) and whose values are tuples of
+ classname,args,kwargs
+ :type cwmap: dict<str,tuple>
"""
# TODO: tango-centric
self._customWidgetMap = cwmap
@@ -312,9 +317,10 @@ class TaurusForm(TaurusWidget):
def getCustomWidgetMap(self):
"""Returns the map used to create custom widgets.
- :return: (dict<str,tuple>) a dictionary whose keys are device
- type strings (i.e. see :class:`PyTango.DeviceInfo`) and whose
- values are tuples of classname,args,kwargs
+ :return: a dictionary whose keys are device type strings (i.e. see
+ :class:`PyTango.DeviceInfo`) and whose values are tuples of
+ classname,args,kwargs
+ :rtype: dict<str,tuple>
"""
# TODO: tango-centric
return self._customWidgetMap
@@ -389,7 +395,9 @@ class TaurusForm(TaurusWidget):
def addModels(self, modelNames):
"""Adds models to the existing ones:
- :param modelNames: (sequence<str>) the names of the models to be added
+ :param modelNames: the names of the models to be added
+ :type modelNames: sequence<str>
+
.. seealso:: :meth:`removeModels`
"""
@@ -400,7 +408,9 @@ class TaurusForm(TaurusWidget):
def removeModels(self, modelNames):
"""Removes models from those already in the form.
- :param modelNames: (sequence<str>) the names of the models to be removed
+ :param modelNames: the names of the models to be removed
+ :type modelNames: sequence<str>
+
.. seealso:: :meth:`addModels`
"""
@@ -432,12 +442,15 @@ class TaurusForm(TaurusWidget):
def getFormWidget(self, model=None):
"""Returns a tuple that can be used for creating a widget for a given model.
- :param model: (str) a taurus model name for which the new item of the
- form will be created
+ :param model: a taurus model name for which the new item of the form
+ will be created
+ :type model: str
- :return: (tuple<type,list,dict>) a tuple containing a class, a list of
- args and a dict of keyword args. The args and the keyword args
- can be passed to the class constructor
+
+ :return: a tuple containing a class, a list of args and a dict of
+ keyword args. The args and the keyword args can be passed to the
+ class constructor
+ :rtype: tuple<type,list,dict>
"""
if model is None:
return self._defaultFormWidget, (), {}
@@ -564,7 +577,9 @@ class TaurusForm(TaurusWidget):
(e.g., via Modify Contents in the context menu)
Reimplemented from :meth:`TaurusWidget.setModifiableByUser`
- :param modifiable: (bool)
+ :param modifiable:
+ :type modifiable: bool
+
.. seealso:: :meth:`TaurusWidget.setModifiableByUser`
"""
@@ -691,7 +706,8 @@ class TaurusForm(TaurusWidget):
def getItemByModel(self, model, index=0):
"""returns the child item with given model. If there is more than one item
with the same model, the index parameter can be used to distinguish among them
- Please note that his index is only relative to same-model items!"""
+ Please note that his index is only relative to same-model items!
+ """
for child in self._children:
if _normalize_model_name_case(
child.getModel()
@@ -824,9 +840,13 @@ class TaurusCommandsForm(TaurusWidget):
def createConfig(self, allowUnpickable=False):
"""
extending :meth:`TaurusBaseWidget.createConfig`
- :param alllowUnpickable: (bool)
+ :param alllowUnpickable:
+ :type alllowUnpickable: bool
+
+
+ :return: configurations (which can be loaded with :meth:`applyConfig`).
+ :rtype: dict<str,object>
- :return: (dict<str,object>) configurations (which can be loaded with :meth:`applyConfig`).
.. seealso: :meth:`TaurusBaseWidget.createConfig`, :meth:`applyConfig`
"""
@@ -841,7 +861,9 @@ class TaurusCommandsForm(TaurusWidget):
def applyConfig(self, configdict, **kwargs):
"""extending :meth:`TaurusBaseWidget.applyConfig` to restore the splitter config
- :param configdict: (dict)
+ :param configdict:
+ :type configdict: dict
+
.. seealso:: :meth:`TaurusBaseWidget.applyConfig`, :meth:`createConfig`
"""
@@ -937,7 +959,8 @@ class TaurusCommandsForm(TaurusWidget):
def _onCommandExecuted(self, result):
"""Slot called when the command is executed, to manage the output
- :param result: return value from the command. The type depends on the command
+ :param result: return value from the command. The type depends on the
+ command
"""
timestamp = datetime.now()
cmdbutton = self.sender()
@@ -960,9 +983,10 @@ class TaurusCommandsForm(TaurusWidget):
def setSortKey(self, sortkey):
"""sets the method used to sort the commands (cmd_name by default)
- :param sortkey: (callable) a function that takes a :class:`CommandInfo`
- as argument and returns a key to use for sorting purposes
- (e.g. the default sortKey is ``lambda x:x.cmd_name``)
+ :param sortkey: a function that takes a :class:`CommandInfo` as
+ argument and returns a key to use for sorting purposes (e.g. the
+ default sortKey is ``lambda x:x.cmd_name``)
+ :type sortkey: callable
"""
self._sortKey = sortkey
self._updateCommandWidgets()
@@ -971,8 +995,9 @@ class TaurusCommandsForm(TaurusWidget):
"""sets the values that will appear by default in the parameters combo box,
the command combo box for the command will be editable only if the first parameter is an empty string
- :param params: (dict<str,list>) { 'cmd_name': ['parameters string 1', 'parameters string 2' ] }
-
+ :param params: { 'cmd_name': ['parameters string 1', 'parameters string
+ 2' ] }
+ :type params: dict<str,list>
"""
self._defaultParameters = dict(
(k.lower(), v) for k, v in params.items()
@@ -982,12 +1007,11 @@ class TaurusCommandsForm(TaurusWidget):
def setViewFilters(self, filterlist):
"""sets the filters to be applied when displaying the commands
- :param filterlist: (sequence<callable>) a sequence of command filters.
- All filters will be applied to each command to decide
- whether to display it or not.
- for a command to be plotted, the following condition
- must be true for all filters:
- bool(filter(command))==True
+ :param filterlist: a sequence of command filters. All filters will be
+ applied to each command to decide whether to display it or not. for
+ a command to be plotted, the following condition must be true for
+ all filters: bool(filter(command))==True
+ :type filterlist: sequence<callable>
"""
self._viewFilters = filterlist
self._updateCommandWidgets()
@@ -995,7 +1019,8 @@ class TaurusCommandsForm(TaurusWidget):
def getViewFilters(self):
"""returns the filters used in deciding which commands are displayed
- :return: (sequence<callable>) a sequence of filters
+ :return: a sequence of filters
+ :rtype: sequence<callable>
"""
return self._viewFilters
@@ -1003,8 +1028,9 @@ class TaurusCommandsForm(TaurusWidget):
def setExpertView(self, expert):
"""sets the expert view mode
- :param expert: (bool) If expert is True, commands won't be filtered. If
- it is False, commands with display level Expert won't be shown
+ :param expert: If expert is True, commands won't be filtered. If it is
+ False, commands with display level Expert won't be shown
+ :type expert: bool
"""
currentfilters = self.getViewFilters()
if expert:
@@ -1020,7 +1046,9 @@ class TaurusCommandsForm(TaurusWidget):
"""returns the splitter that separates the command buttons area from
the output area
- :return: (QSplitter)"""
+ :return:
+ :rtype: QSplitter
+ """
return self._splitter
@classmethod
@@ -1055,10 +1083,10 @@ class TaurusAttrForm(TaurusWidget):
def setSortKey(self, sortkey):
"""sets the key function used to sort the attributes in the form
- :param sortkey: (callable) a function that takes a :class:`AttributeInfo`
- as argument and returns a key to use for sorting purposes
- (e.g. the default sortKey is ``lambda x:x.name``)
-
+ :param sortkey: a function that takes a :class:`AttributeInfo` as
+ argument and returns a key to use for sorting purposes (e.g. the
+ default sortKey is ``lambda x:x.name``)
+ :type sortkey: callable
"""
self._sortKey = sortkey
self._updateAttrWidgets()
@@ -1090,11 +1118,11 @@ class TaurusAttrForm(TaurusWidget):
def setViewFilters(self, filterlist):
"""sets the filters to be applied when displaying the attributes
- :param filterlist: (sequence<callable>) a sequence of attr filters. All
- filters will be applied to each attribute name to
- decide whether to display it or not. for an attribute
- to be plotted, the following condition must be true
- for all filters: ``bool(filter(attrname))==True``
+ :param filterlist: a sequence of attr filters. All filters will be
+ applied to each attribute name to decide whether to display it or
+ not. for an attribute to be plotted, the following condition must
+ be true for all filters: ``bool(filter(attrname))==True``
+ :type filterlist: sequence<callable>
"""
self._viewFilters = filterlist
self._updateAttrWidgets()
@@ -1102,7 +1130,8 @@ class TaurusAttrForm(TaurusWidget):
def getViewFilters(self):
"""returns the filters used in deciding which attributes are displayed
- :return: (sequence<callable>) a sequence of filters
+ :return: a sequence of filters
+ :rtype: sequence<callable>
"""
return self._viewFilters
@@ -1110,9 +1139,9 @@ class TaurusAttrForm(TaurusWidget):
def setExpertView(self, expert):
"""sets the expert view mode
- :param expert: (bool) If expert is True, attributes won't be filtered. If
- it is False, attributes with display level Expert won't
- be shown
+ :param expert: If expert is True, attributes won't be filtered. If it
+ is False, attributes with display level Expert won't be shown
+ :type expert: bool
"""
currentfilters = self.getViewFilters()
if expert:
diff --git a/lib/taurus/qt/qtgui/panel/taurusinputpanel.py b/lib/taurus/qt/qtgui/panel/taurusinputpanel.py
index d5e3bc75..8dda46a1 100644
--- a/lib/taurus/qt/qtgui/panel/taurusinputpanel.py
+++ b/lib/taurus/qt/qtgui/panel/taurusinputpanel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides an Input panel (usually used inside a TaurusDialog)"""
+"""This module provides an Input panel (usually used inside a TaurusDialog)
+"""
from collections.abc import Sequence, Mapping
import numpy
@@ -353,7 +354,8 @@ class TaurusInputPanel(Qt.QWidget):
"""Returns the button box from this panel
:return: the button box from this panel
- :rtype: PyQt5.Qt.QDialogButtonBox"""
+ :rtype: PyQt5.Qt.QDialogButtonBox
+ """
return self._ui._buttonBox
def addButton(self, button, role=Qt.QDialogButtonBox.ActionRole):
@@ -362,28 +364,32 @@ class TaurusInputPanel(Qt.QWidget):
:param button: the button to be added
:type button: PyQt5.Qt.QPushButton
:param role: button role
- :type role: PyQt5.Qt.QDialogButtonBox.ButtonRole"""
+ :type role: PyQt5.Qt.QDialogButtonBox.ButtonRole
+ """
self._ui._buttonBox.addButton(button, role)
def setIconPixmap(self, pixmap):
"""Sets the icon to the dialog
:param pixmap: the icon pixmap
- :type pixmap: PyQt5.Qt.QPixmap"""
+ :type pixmap: PyQt5.Qt.QPixmap
+ """
self._ui.iconLabel.setPixmap(pixmap)
def setText(self, text):
"""Sets the text of this panel
:param text: the new text
- :type text: str"""
+ :type text: str
+ """
self._ui.textLabel.setText(text)
def getText(self):
"""Returns the current text of this panel
:return: the text for this panel
- :rtype: str"""
+ :rtype: str
+ """
return self._ui.textLabel.text()
def setInputFocus(self):
diff --git a/lib/taurus/qt/qtgui/panel/taurusmessagepanel.py b/lib/taurus/qt/qtgui/panel/taurusmessagepanel.py
index efce94b9..ebd10ddd 100644
--- a/lib/taurus/qt/qtgui/panel/taurusmessagepanel.py
+++ b/lib/taurus/qt/qtgui/panel/taurusmessagepanel.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides a panel to display taurus messages"""
+"""This module provides a panel to display taurus messages
+"""
import sys
import traceback
@@ -54,7 +55,8 @@ __docformat__ = "restructuredtext"
class TaurusMessageErrorHandler(object):
"""This class is designed to handle a generic error into a
- :class:`TaurusMessagePanel`"""
+ :class:`TaurusMessagePanel`
+ """
def __init__(self, msgbox):
self._msgbox = msgbox
@@ -66,7 +68,8 @@ class TaurusMessageErrorHandler(object):
in the message panel
:param error: an error object (typically an exception object)
- :type error: object"""
+ :type error: object
+ """
msgbox = self._msgbox
error = "".join(traceback.format_exception_only(err_type, err_value))
@@ -97,7 +100,8 @@ class TaurusMessageErrorHandler(object):
class TangoMessageErrorHandler(TaurusMessageErrorHandler):
"""This class is designed to handle :class:`PyTango.DevFailed` error into
- a :class:`TaurusMessagePanel`"""
+ a :class:`TaurusMessagePanel`
+ """
# TODO: tango-centric
@@ -106,7 +110,8 @@ class TangoMessageErrorHandler(TaurusMessageErrorHandler):
it the message panel
:param error: an error object (typically an exception object)
- :type error: object"""
+ :type error: object
+ """
msgbox = self._msgbox
html_orig = (
@@ -148,7 +153,8 @@ class MacroServerMessageErrorHandler(TaurusMessageErrorHandler):
in the message panel
:param error: an error object (typically an exception object)
- :type error: object"""
+ :type error: object
+ """
msgbox = self._msgbox
msgbox.setText(err_value)
@@ -173,7 +179,8 @@ class MacroServerMessageErrorHandler(TaurusMessageErrorHandler):
def is_report_handler(report, abs_file=None):
"""Helper function to determine if a certain python object is a valid
- report handler"""
+ report handler
+ """
import inspect
if not inspect.isclass(report):
@@ -342,49 +349,56 @@ class TaurusMessagePanel(Qt.QWidget):
"""Returns the check box from this panel
:return: the check box from this panel
- :rtype: PyQt5.Qt.QCheckBox"""
+ :rtype: PyQt5.Qt.QCheckBox
+ """
return self._ui._checkBox
def checkBoxState(self):
"""Returns the check box state
:return: the check box state
- :rtype: PyQt5.Qt.CheckState"""
+ :rtype: PyQt5.Qt.CheckState
+ """
return self.checkBox().checkState()
def checkBoxText(self):
"""Returns the check box text
:return: the check box text
- :rtype: str"""
+ :rtype: str
+ """
return str(self.checkBox().text())
def setCheckBoxText(self, text):
"""Sets the checkbox text.
:param text: new checkbox text
- :type text: str"""
+ :type text: str
+ """
self.checkBox().setText(text)
def setCheckBoxState(self, state):
"""Sets the checkbox state.
:param text: new checkbox state
- :type text: PyQt5.Qt.CheckState"""
+ :type text: PyQt5.Qt.CheckState
+ """
self.checkBox().setCheckState(state)
def setCheckBoxVisible(self, visible):
"""Sets the checkbox visibility.
:param visible: True makes checkbox visible, False hides it
- :type visible: bool"""
+ :type visible: bool
+ """
self.checkBox().setVisible(visible)
def buttonBox(self):
"""Returns the button box from this panel
:return: the button box from this panel
- :rtype: PyQt5.Qt.QDialogButtonBox"""
+ :rtype: PyQt5.Qt.QDialogButtonBox
+ """
return self._ui._buttonBox
def addButton(self, button, role=Qt.QDialogButtonBox.ActionRole):
@@ -393,84 +407,96 @@ class TaurusMessagePanel(Qt.QWidget):
:param button: the button to be added
:type button: PyQt5.Qt.QPushButton
:param role: button role
- :type role: PyQt5.Qt.QDialogButtonBox.ButtonRole"""
+ :type role: PyQt5.Qt.QDialogButtonBox.ButtonRole
+ """
self._ui._buttonBox.addButton(button, role)
def setIconPixmap(self, pixmap):
"""Sets the icon to the dialog
:param pixmap: the icon pixmap
- :type pixmap: PyQt5.Qt.QPixmap"""
+ :type pixmap: PyQt5.Qt.QPixmap
+ """
self._ui._iconLabel.setPixmap(pixmap)
def setText(self, text):
"""Sets the text of this panel
:param text: the new text
- :type text: str"""
+ :type text: str
+ """
self._ui._textLabel.setText(text)
def getText(self):
"""Returns the current text of this panel
:return: the text for this panel
- :rtype: str"""
+ :rtype: str
+ """
return self._ui._textLabel.text()
def setDetailedText(self, text):
"""Sets the detailed text of the dialog
:param text: the new text
- :type text: str"""
+ :type text: str
+ """
self._ui._detailsTextEdit.setPlainText(text)
def setDetailedHtml(self, html):
"""Sets the detailed HTML of the dialog
:param html: the new HTML text
- :type html: str"""
+ :type html: str
+ """
self._ui._detailsTextEdit.setHtml(html)
def getDetailedText(self):
"""Returns the current detailed text of this panel
:return: the detailed text for this panel
- :rtype: str"""
+ :rtype: str
+ """
return self._ui._detailsTextEdit.toPlainText()
def getDetailedHtml(self):
"""Returns the current detailed HTML of this panel
:return: the detailed HTML for this panel
- :rtype: str"""
+ :rtype: str
+ """
return self._ui._detailsTextEdit.toHtml()
def setOriginText(self, text):
"""Sets the origin text of the dialog
:param text: the new text
- :type text: str"""
+ :type text: str
+ """
self._ui._originTextEdit.setPlainText(text)
def setOriginHtml(self, html):
"""Sets the origin HTML of the dialog
:param html: the new HTML text
- :type html: str"""
+ :type html: str
+ """
self._ui._originTextEdit.setHtml(html)
def getOriginText(self):
"""Returns the current origin text of this panel
:return: the origin text for this panel
- :rtype: str"""
+ :rtype: str
+ """
return self._ui._originTextEdit.toPlainText()
def getOriginHtml(self):
"""Returns the current origin HTML of this panel
:return: the origin HTML for this panel
- :rtype: str"""
+ :rtype: str
+ """
return self._ui._originTextEdit.toHtml()
def setError(self, err_type=None, err_value=None, err_traceback=None):
@@ -489,15 +515,15 @@ class TaurusMessagePanel(Qt.QWidget):
msgbox.setError(*exc_info)
msgbox.show()
- :param err_type: the exception type of the exception being handled
- (a class object)
+ :param err_type: the exception type of the exception being handled (a
+ class object)
:type error: class object
:param err_value: exception object
:type err_value: object
:param err_traceback: a traceback object which encapsulates the call
- stack at the point where the exception originally
- occurred
- :type err_traceback: TracebackType"""
+ stack at the point where the exception originally occurred
+ :type err_traceback: TracebackType
+ """
i = sys.exc_info()
self._exc_info = [
err_type or i[0],
@@ -512,8 +538,9 @@ class TaurusMessagePanel(Qt.QWidget):
"""Returns the current exception information of this panel
:return: the current exception information (same as type as returned by
- :func:`sys.exc_info`)
- :rtype: tuple<type, Exception, traceback>"""
+ :func:`sys.exc_info`)
+ :rtype: tuple<type, Exception, traceback>
+ """
return self._exc_info
try:
@@ -534,7 +561,8 @@ class TaurusMessagePanel(Qt.QWidget):
:param err_type: error class
:type err_type: class object
:return: a message box error handler
- :rtype: TaurusMessageBoxErrorHandler class object"""
+ :rtype: TaurusMessageBoxErrorHandler class object
+ """
for exc, h_klass in klass.ErrorHandlers.items():
if issubclass(err_type, exc):
diff --git a/lib/taurus/qt/qtgui/panel/taurusmodelchooser.py b/lib/taurus/qt/qtgui/panel/taurusmodelchooser.py
index 20a4b586..34da4b0f 100644
--- a/lib/taurus/qt/qtgui/panel/taurusmodelchooser.py
+++ b/lib/taurus/qt/qtgui/panel/taurusmodelchooser.py
@@ -325,13 +325,18 @@ class TaurusModelChooser(TaurusWidget):
):
"""Creator of TaurusModelChooser
- :param parent: (QObject) parent for the dialog
- :param selectables: (list<TaurusElementType>) if passed, only elements of the tree whose
- type is in the list will be selectable.
- :param host: (QObject) Tango host to be explored by the chooser
- :param designMode: (bool) needed for taurusdesigner but ignored here
- :param singleModel: (bool) If True, the selection will be of just one
- model. Otherwise (default) a list of models can be selected
+ :param parent: parent for the dialog
+ :type parent: QObject
+ :param selectables: if passed, only elements of the tree whose type is
+ in the list will be selectable.
+ :type selectables: list<TaurusElementType>
+ :param host: Tango host to be explored by the chooser
+ :type host: QObject
+ :param designMode: needed for taurusdesigner but ignored here
+ :type designMode: bool
+ :param singleModel: If True, the selection will be of just one model.
+ Otherwise (default) a list of models can be selected
+ :type singleModel: bool
"""
TaurusWidget.__init__(self, parent)
@@ -386,13 +391,17 @@ class TaurusModelChooser(TaurusWidget):
def getListedModels(self, asMimeData=False):
"""returns the list of models that have been added
- :param asMimeData: (bool) If False (default), the return value will be a
- list of models. If True, the return value is a
- `QMimeData` containing at least `TAURUS_MODEL_LIST_MIME_TYPE`
- and `text/plain` MIME types. If only one model was selected,
- the mime data also contains a TAURUS_MODEL_MIME_TYPE.
+ :param asMimeData: If False (default), the return value will be a list
+ of models. If True, the return value is a `QMimeData` containing at
+ least `TAURUS_MODEL_LIST_MIME_TYPE` and `text/plain` MIME types. If
+ only one model was selected, the mime data also contains a
+ TAURUS_MODEL_MIME_TYPE.
+ :type asMimeData: bool
- :return: (list<str> or QMimeData) the type of return depends on the value of `asMimeData`"""
+
+ :return: the type of return depends on the value of `asMimeData`
+ :rtype: list<str> or QMimeData
+ """
models = self.list.getModelList()
if self.isSingleModelMode():
models = models[:1]
@@ -461,7 +470,8 @@ class TaurusModelChooser(TaurusWidget):
def setSingleModelMode(self, single):
"""sets whether the selection should be limited to just one model
- (single=True) or not (single=False)"""
+ (single=True) or not (single=False)
+ """
if single:
self.tree.treeView().setSelectionMode(
Qt.QAbstractItemView.SingleSelection
@@ -475,7 +485,9 @@ class TaurusModelChooser(TaurusWidget):
def isSingleModelMode(self):
"""returns True if the selection is limited to just one model. Returns False otherwise.
- :return: (bool)"""
+ :return:
+ :rtype: bool
+ """
return self._singleModelMode
def resetSingleModelMode(self):
@@ -494,24 +506,33 @@ class TaurusModelChooser(TaurusWidget):
):
"""Static method that launches a modal dialog containing a TaurusModelChooser
- :param parent: (QObject) parent for the dialog
- :param selectables: (list<TaurusElementType>) if passed, only elements of the tree whose
- type is in the list will be selectable.
- :param host: (QObject) Tango host to be explored by the chooser
- :param asMimeData: (bool) If False (default), a list of models will be.
- returned. If True, a `QMimeData` object will be
- returned instead. See :meth:`getListedModels` for a
- detailed description of this QMimeData object.
- :param singleModel: (bool) If True, the selection will be of just one
- model. Otherwise (default) a list of models can be selected
- :param windowTitle: (str) Title of the dialog (default="Model Chooser")
- :param listedModels: (list<str>) List of model names for initializing the
- model list
-
- :return: (list,bool or QMimeData,bool) Returns a models,ok tuple. models can be
- either a list of models or a QMimeData object, depending on
- `asMimeData`. ok is True if the dialog was accepted (by
- clicking on the "update" button) and False otherwise
+ :param parent: parent for the dialog
+ :type parent: QObject
+ :param selectables: if passed, only elements of the tree whose type is
+ in the list will be selectable.
+ :type selectables: list<TaurusElementType>
+ :param host: Tango host to be explored by the chooser
+ :type host: QObject
+ :param asMimeData: If False (default), a list of models will be.
+ returned. If True, a `QMimeData` object will be returned instead.
+ See :meth:`getListedModels` for a detailed description of this
+ QMimeData object.
+ :type asMimeData: bool
+ :param singleModel: If True, the selection will be of just one model.
+ Otherwise (default) a list of models can be selected
+ :type singleModel: bool
+ :param windowTitle: Title of the dialog (default="Model Chooser")
+ :type windowTitle: str
+ :param listedModels: List of model names for initializing the model
+ list
+ :type listedModels: list<str>
+
+
+ :return: Returns a models,ok tuple. models can be either a list of
+ models or a QMimeData object, depending on `asMimeData`. ok is True
+ if the dialog was accepted (by clicking on the "update" button) and
+ False otherwise
+ :rtype: list,bool or QMimeData,bool
"""
dlg = Qt.QDialog(parent)
dlg.setWindowTitle(windowTitle)
diff --git a/lib/taurus/qt/qtgui/panel/taurusmodellist.py b/lib/taurus/qt/qtgui/panel/taurusmodellist.py
index d1f871d9..4d6dfb2f 100644
--- a/lib/taurus/qt/qtgui/panel/taurusmodellist.py
+++ b/lib/taurus/qt/qtgui/panel/taurusmodellist.py
@@ -50,7 +50,8 @@ SRC_ROLE = Qt.Qt.UserRole + 1
class TaurusModelItem(object):
"""An item object for :class:`TaurusModelModel`. Exposes `display` `icon` and `ok`
- attributes which are calculated and kept in synch with the property `src`"""
+ attributes which are calculated and kept in synch with the property `src`
+ """
def __init__(self, src=None, display=None):
self.icon = Qt.QIcon()
@@ -165,7 +166,9 @@ class TaurusModelModel(Qt.QAbstractListModel):
def addItem(self, item):
"""appends an item to the internal list
- :param item: (TaurusModelItem)"""
+ :param item:
+ :type item: TaurusModelItem
+ """
self.items.append(item)
def dumpData(self):
@@ -295,11 +298,14 @@ class TaurusModelModel(Qt.QAbstractListModel):
def insertItems(self, row, items):
"""convenience method to add new rows by passing a list of strings ()
- :param row: (int) the row of the list at which the item insertion
- starts, if row==-1, items will be appended to the list
- :param items: (seq) a sequence items to add to the list. The objects
- in the sequence can be either strings, :class:`TaurusModelItem` objects
- or tuples of valid arguments for initializing :class:`TaurusModelItem` objects
+ :param row: the row of the list at which the item insertion starts, if
+ row==-1, items will be appended to the list
+ :type row: int
+ :param items: a sequence items to add to the list. The objects in the
+ sequence can be either strings, :class:`TaurusModelItem` objects or
+ tuples of valid arguments for initializing :class:`TaurusModelItem`
+ objects
+ :type items: seq
"""
itemobjs = []
for e in items:
@@ -466,8 +472,9 @@ class TaurusModelList(Qt.QListView):
def newRow(self, position=None):
"""adds an empty row *before* the given position
- :param position: (int or None) position at which the new row will be added.
- If None passed, it will be added at the end.
+ :param position: position at which the new row will be added. If None
+ passed, it will be added at the end.
+ :type position: int or None
"""
if position is None:
selected = self.selectionModel().selectedIndexes()
@@ -491,14 +498,17 @@ class TaurusModelList(Qt.QListView):
def addModels(self, models):
"""adds models to the list
- :param models: (list<str>) sequence of model names to be added
+ :param models: sequence of model names to be added
+ :type models: list<str>
"""
self._model.insertItems(-1, models)
def getModelItems(self):
"""returns the model item objects
- :return: (list<TaurusModelItem>)
+ :return:
+ :rtype: list<TaurusModelItem>
+
.. seealso:: :meth:`getModelList`
"""
@@ -507,7 +517,9 @@ class TaurusModelList(Qt.QListView):
def getModelList(self):
"""returns a the model names corresponding to the items in the list
- :return: (list<str>)
+ :return:
+ :rtype: list<str>
+
.. seealso:: :meth:`getModelItems`
"""
diff --git a/lib/taurus/qt/qtgui/panel/taurusvalue.py b/lib/taurus/qt/qtgui/panel/taurusvalue.py
index 7f6845f8..2126be74 100644
--- a/lib/taurus/qt/qtgui/panel/taurusvalue.py
+++ b/lib/taurus/qt/qtgui/panel/taurusvalue.py
@@ -146,7 +146,8 @@ class DefaultLabelWidget(TaurusLabel):
def contextMenuEvent(self, event):
"""The label widget will be used for handling the actions of the whole TaurusValue
- see :meth:`QWidget.contextMenuEvent`"""
+ see :meth:`QWidget.contextMenuEvent`
+ """
menu = Qt.QMenu(self)
# @todo: This should be done more Taurus-ish
menu.addMenu(ConfigurationMenu(self.taurusValueBuddy()))
@@ -556,14 +557,16 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
Returns the default class (or classes) to use as read widget for the
current model.
- :param returnAll: (bool) if True, the return value is a list of valid
- classes instead of just one class
+ :param returnAll: if True, the return value is a list of valid classes
+ instead of just one class
+ :type returnAll: bool
+
- :return: (class or list<class>) the default class to use for the read
- widget (or, if returnAll==True, a list of classes that can show
- the attribute ). If a list is returned, it will be loosely
- ordered by preference, being the first element always the
- default one.
+ :return: the default class to use for the read widget (or, if
+ returnAll==True, a list of classes that can show the attribute ).
+ If a list is returned, it will be loosely ordered by preference,
+ being the first element always the default one.
+ :rtype: class or list<class>
"""
modelobj = self.getModelObj()
if modelobj is None:
@@ -642,14 +645,16 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
Returns the default class (or classes) to use as write widget for the
current model.
- :param returnAll: (bool) if True, the return value is a list of valid
- classes instead of just one class
+ :param returnAll: if True, the return value is a list of valid classes
+ instead of just one class
+ :type returnAll: bool
- :return: (class or list<class>) the default class to use for the write
- widget (or, if returnAll==True, a list of classes that can show
- the attribute ). If a list is returned, it will be loosely
- ordered by preference, being the first element always the
- default one.
+
+ :return: the default class to use for the write widget (or, if
+ returnAll==True, a list of classes that can show the attribute ).
+ If a list is returned, it will be loosely ordered by preference,
+ being the first element always the default one.
+ :rtype: class or list<class>
"""
modelclass = self.getModelClass()
if self.isReadOnly() or (
@@ -726,9 +731,10 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
def setCustomWidgetMap(self, cwmap):
"""Sets a map map for custom widgets.
- :param cwmap: (dict<str,Qt.QWidget>) a dictionary whose keys are device
- class strings (see :class:`PyTango.DeviceInfo`) and
- whose values are widget classes to be used
+ :param cwmap: a dictionary whose keys are device class strings (see
+ :class:`PyTango.DeviceInfo`) and whose values are widget classes to
+ be used
+ :type cwmap: dict<str,Qt.QWidget>
"""
self._customWidgetMap = cwmap
@@ -736,9 +742,10 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
def getCustomWidgetMap(self):
"""Returns the map used to create custom widgets.
- :return: (dict<str,Qt.QWidget>) a dictionary whose keys are device
- type strings (i.e. see :class:`PyTango.DeviceInfo`) and whose
- values are widgets to be used
+ :return: a dictionary whose keys are device type strings (i.e. see
+ :class:`PyTango.DeviceInfo`) and whose values are widgets to be
+ used
+ :rtype: dict<str,Qt.QWidget>
"""
return self._customWidgetMap
@@ -821,7 +828,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
def _newSubwidget(self, oldWidget, newClass):
"""eliminates oldWidget and returns a new one.
If newClass is None, None is returned
- If newClass is the same as the olWidget class, nothing happens"""
+ If newClass is the same as the olWidget class, nothing happens
+ """
if oldWidget.__class__ == newClass:
return oldWidget
if oldWidget is not None:
@@ -1151,7 +1159,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
def parentModelChanged(self, parentmodel_name):
"""Invoked when the parent model changes
- :param parentmodel_name: (str) the new name of the parent model
+ :param parentmodel_name: the new name of the parent model
+ :type parentmodel_name: str
"""
TaurusBaseWidget.parentModelChanged(self, parentmodel_name)
if not self._designMode: # in design mode, no subwidgets are created
@@ -1165,7 +1174,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
@Qt.pyqtSlot("QString", name="setLabelWidget")
def setLabelWidgetClass(self, classID):
"""substitutes the current widget by a new one. classID can be one of:
- None, 'Auto', a TaurusWidget class name, or any class"""
+ None, 'Auto', a TaurusWidget class name, or any class
+ """
self.labelWidgetClassID = classID
self.updateLabelWidget()
@@ -1178,7 +1188,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
@Qt.pyqtSlot("QString", name="setReadWidget")
def setReadWidgetClass(self, classID):
"""substitutes the current widget by a new one. classID can be one of:
- None, 'Auto', a TaurusWidget class name, or any class"""
+ None, 'Auto', a TaurusWidget class name, or any class
+ """
self.readWidgetClassID = classID
self.updateReadWidget()
@@ -1191,7 +1202,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
@Qt.pyqtSlot("QString", name="setWriteWidget")
def setWriteWidgetClass(self, classID):
"""substitutes the current widget by a new one. classID can be one of:
- None, 'Auto', a TaurusWidget class name, or any class"""
+ None, 'Auto', a TaurusWidget class name, or any class
+ """
self.writeWidgetClassID = classID
self.updateWriteWidget()
@@ -1204,7 +1216,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
@Qt.pyqtSlot("QString", name="setUnitsWidget")
def setUnitsWidgetClass(self, classID):
"""substitutes the current widget by a new one. classID can be one of:
- None, 'Auto', a TaurusWidget class name, or any class"""
+ None, 'Auto', a TaurusWidget class name, or any class
+ """
self.unitsWidgetClassID = classID
self.updateUnitsWidget()
@@ -1218,7 +1231,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
@Qt.pyqtSlot("QString", name="setCustomWidget")
def setCustomWidgetClass(self, classID):
"""substitutes the current widget by a new one. classID can be one of:
- None, 'Auto', a TaurusWidget class name, or any class"""
+ None, 'Auto', a TaurusWidget class name, or any class
+ """
self.customWidgetClassID = classID
self.__updateCustomWidget()
@@ -1233,7 +1247,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
@Qt.pyqtSlot("QString", name="setExtraWidget")
def setExtraWidgetClass(self, classID):
"""substitutes the current widget by a new one. classID can be one of:
- None, 'Auto', a TaurusWidget class name, or any class"""
+ None, 'Auto', a TaurusWidget class name, or any class
+ """
self.extraWidgetClassID = classID
self.updateExtraWidget()
@@ -1293,9 +1308,13 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
"""
extending :meth:`TaurusBaseWidget.createConfig` to store also the class names for subwidgets
- :param alllowUnpickable: (bool)
+ :param alllowUnpickable:
+ :type alllowUnpickable: bool
+
+
+ :return: configurations (which can be loaded with :meth:`applyConfig`).
+ :rtype: dict<str,object>
- :return: (dict<str,object>) configurations (which can be loaded with :meth:`applyConfig`).
.. seealso: :meth:`TaurusBaseWidget.createConfig`, :meth:`applyConfig`
"""
@@ -1334,7 +1353,9 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
def applyConfig(self, configdict, **kwargs):
"""extending :meth:`TaurusBaseWidget.applyConfig` to restore the subwidget's classes
- :param configdict: (dict)
+ :param configdict:
+ :type configdict: dict
+
.. seealso:: :meth:`TaurusBaseWidget.applyConfig`, :meth:`createConfig`
"""
@@ -1370,7 +1391,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
@Qt.pyqtSlot("QString")
def setModel(self, model):
"""extending :meth:`TaurusBaseWidget.setModel` to change the modelclass
- dynamically and to update the subwidgets"""
+ dynamically and to update the subwidgets
+ """
self.__modelClass = taurus.Manager().findObjectClass(model or "")
TaurusBaseWidget.setModel(self, model)
if not self._designMode: # in design mode, no subwidgets are created
@@ -1423,7 +1445,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
"""self.getPendingOperations will always return an empty list, but still
self.hasPendingOperations will look at the writeWidget's operations.
If you want to ask the TaurusValue for its pending operations, call
- self.writeWidget().getPendingOperations()"""
+ self.writeWidget().getPendingOperations()
+ """
w = self.writeWidget(followCompact=True)
if w is None:
return False
@@ -1558,7 +1581,8 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
class TaurusValuesFrame(TaurusFrame):
"""This is a container specialized into containing TaurusValue widgets.
- It should be used Only for TaurusValues"""
+ It should be used Only for TaurusValues
+ """
_model = []
diff --git a/lib/taurus/qt/qtgui/panel/test/test_taurusform.py b/lib/taurus/qt/qtgui/panel/test/test_taurusform.py
index ccbdd0a2..767f0e8a 100644
--- a/lib/taurus/qt/qtgui/panel/test/test_taurusform.py
+++ b/lib/taurus/qt/qtgui/panel/test/test_taurusform.py
@@ -22,7 +22,8 @@
##
#############################################################################
-"""Unit tests for Taurus Forms"""
+"""Unit tests for Taurus Forms
+"""
from taurus.qt.qtgui.panel import TaurusForm, TaurusValue
from taurus.core.util.test.test_plugin import mock_entry_point
diff --git a/lib/taurus/qt/qtgui/panel/test/test_taurusvalue.py b/lib/taurus/qt/qtgui/panel/test/test_taurusvalue.py
index 4fea4575..b1bd9dee 100644
--- a/lib/taurus/qt/qtgui/panel/test/test_taurusvalue.py
+++ b/lib/taurus/qt/qtgui/panel/test/test_taurusvalue.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Test for taurus.qt.qtgui.panel.taurusvalue"""
+"""Test for taurus.qt.qtgui.panel.taurusvalue
+"""
import pytest
from taurus.qt.qtgui.panel import TaurusValue
diff --git a/lib/taurus/qt/qtgui/plot/__init__.py b/lib/taurus/qt/qtgui/plot/__init__.py
index 206f515c..03c5c880 100644
--- a/lib/taurus/qt/qtgui/plot/__init__.py
+++ b/lib/taurus/qt/qtgui/plot/__init__.py
@@ -37,7 +37,6 @@ of plot and trend widgets based on Qwt5, but this is no longer available
since the `PyQwt5 module <http://pyqwt.sourceforge.net/>`_
only works with Python2 and PyQt4 and is no longer supported,
so taurus moved to other modules for plotting (pyqtgraph, silx, ...)
-
"""
from taurus.core.util import log as __log
diff --git a/lib/taurus/qt/qtgui/resource/taurus_resource_utils.py b/lib/taurus/qt/qtgui/resource/taurus_resource_utils.py
index 419dc011..f532e318 100644
--- a/lib/taurus/qt/qtgui/resource/taurus_resource_utils.py
+++ b/lib/taurus/qt/qtgui/resource/taurus_resource_utils.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides widgets that display the database in a tree format"""
+"""This module provides widgets that display the database in a tree format
+"""
__all__ = [
"getPixmap",
@@ -69,8 +70,9 @@ def getThemeMembers():
Alternatively Just test a given name using
:return: the current icon theme elements in a dictionary where each key is
- a group name and the value is a sequence of theme icon name.
- :rtype: dict<str,seq<str>>"""
+ a group name and the value is a sequence of theme icon name.
+ :rtype: dict<str,seq<str>>
+ """
return {}
@@ -92,9 +94,13 @@ def getIcon(key):
Note that taurus.qt.qtgui.resource already sets several search paths based
on .path files
- :param key: (str) the pixmap file name. (optionally with a prefix)
+ :param key: the pixmap file name. (optionally with a prefix)
+ :type key: str
+
- :return: (PyQt5.Qt.QIcon) a PyQt5.Qt.QIcon for the given key"""
+ :return: a PyQt5.Qt.QIcon for the given key
+ :rtype: PyQt5.Qt.QIcon
+ """
# handle resource syntax (deprecated)
if key.startswith(":"):
@@ -126,11 +132,15 @@ def getThemePixmap(key, size=48):
If the key cannot be found, it will return a null content Pixmap.
- :param key: (str) a string with the pixmap theme key (ex.: 'folder_open')
- :param size: (int) the pixmap size in pixels (will get a square pixmap).
- Default size=48
+ :param key: a string with the pixmap theme key (ex.: 'folder_open')
+ :type key: str
+ :param size: the pixmap size in pixels (will get a square pixmap). Default
+ size=48
+ :type size: int
- :return: (PyQt5.Qt.QPixmap)
+
+ :return:
+ :rtype: PyQt5.Qt.QPixmap
"""
return Qt.QIcon.fromTheme(key).pixmap(size, size)
@@ -144,9 +154,12 @@ def getThemeIcon(key):
use the bundled 'Tango' icons theme. See:
`Tango Icon Library <http://tango.freedesktop.org/Tango_Icon_Library>`_.
- :param key: (str) a string with the icon theme key (e.g.: 'folder_open')
+ :param key: a string with the icon theme key (e.g.: 'folder_open')
+ :type key: str
+
- :return: (PyQt5.Qt.QIcon) a PyQt5.Qt.QIcon for the given theme key
+ :return: a PyQt5.Qt.QIcon for the given theme key
+ :rtype: PyQt5.Qt.QIcon
"""
return Qt.QIcon.fromTheme(key)
diff --git a/lib/taurus/qt/qtgui/style/__init__.py b/lib/taurus/qt/qtgui/style/__init__.py
index 7e1ba9da..9f0f48a9 100644
--- a/lib/taurus/qt/qtgui/style/__init__.py
+++ b/lib/taurus/qt/qtgui/style/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides Qt styles"""
+"""This module provides Qt styles
+"""
__all__ = ["setTaurusStyle"]
diff --git a/lib/taurus/qt/qtgui/style/nebula.py b/lib/taurus/qt/qtgui/style/nebula.py
index ad1cf133..bd2b7da0 100644
--- a/lib/taurus/qt/qtgui/style/nebula.py
+++ b/lib/taurus/qt/qtgui/style/nebula.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module contains a taurus qt style called nebula"""
+"""This module contains a taurus qt style called nebula
+"""
__all__ = ["getStyle", "getStyleSheet"]
diff --git a/lib/taurus/qt/qtgui/table/__init__.py b/lib/taurus/qt/qtgui/table/__init__.py
index 7ce2bee0..4f3c6013 100644
--- a/lib/taurus/qt/qtgui/table/__init__.py
+++ b/lib/taurus/qt/qtgui/table/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package provides taurus Qt table widgets"""
+"""This package provides taurus Qt table widgets
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/table/qdictionary.py b/lib/taurus/qt/qtgui/table/qdictionary.py
index d0f44bc6..ed1561e9 100644
--- a/lib/taurus/qt/qtgui/table/qdictionary.py
+++ b/lib/taurus/qt/qtgui/table/qdictionary.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides basic python dictionary/list editor widgets"""
+"""This module provides basic python dictionary/list editor widgets
+"""
import sys
diff --git a/lib/taurus/qt/qtgui/table/qlogtable.py b/lib/taurus/qt/qtgui/table/qlogtable.py
index 4f91ca8a..a24afdc6 100644
--- a/lib/taurus/qt/qtgui/table/qlogtable.py
+++ b/lib/taurus/qt/qtgui/table/qlogtable.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides Qt table widgets which display logging messages from the
-python :mod:`logging` module"""
+python :mod:`logging` module
+"""
from operator import attrgetter
@@ -375,7 +376,8 @@ class QLoggingTable(Qt.QTableView):
def rowsInserted(self, index, start, end):
"""Overwrite of slot rows inserted to do proper resize and scroll to
- bottom if desired"""
+ bottom if desired
+ """
Qt.QTableView.rowsInserted(self, index, start, end)
for i in range(start, end + 1):
self.resizeRowToContents(i)
diff --git a/lib/taurus/qt/qtgui/table/qtable.py b/lib/taurus/qt/qtgui/table/qtable.py
index 6dc1264a..6f38614c 100644
--- a/lib/taurus/qt/qtgui/table/qtable.py
+++ b/lib/taurus/qt/qtgui/table/qtable.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides base table widget"""
+"""This module provides base table widget
+"""
__all__ = ["QBaseTableWidget"]
diff --git a/lib/taurus/qt/qtgui/table/taurusdbtable.py b/lib/taurus/qt/qtgui/table/taurusdbtable.py
index 075f8e6b..26b102db 100644
--- a/lib/taurus/qt/qtgui/table/taurusdbtable.py
+++ b/lib/taurus/qt/qtgui/table/taurusdbtable.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides a base widget that can be used to display a taurus
-model in a table widget"""
+model in a table widget
+"""
# todo: tango-centric!!!
diff --git a/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py b/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
index 780c6f42..a0c765b5 100644
--- a/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
+++ b/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
@@ -216,7 +216,8 @@ class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget):
def contextMenuEvent(self, event):
"""This function is called when right clicking on qwt plot area. A pop up menu will be
- shown with the available options."""
+ shown with the available options.
+ """
self.info("TaurusPropTable.contextMenuEvent()")
menu = Qt.QMenu(self)
configDialogAction = menu.addAction("Add new property")
diff --git a/lib/taurus/qt/qtgui/table/taurusgrid.py b/lib/taurus/qt/qtgui/table/taurusgrid.py
index b2376de7..dd047d4c 100644
--- a/lib/taurus/qt/qtgui/table/taurusgrid.py
+++ b/lib/taurus/qt/qtgui/table/taurusgrid.py
@@ -1147,7 +1147,7 @@ The format of the call is something like:
\t/usr/bin/python taurusgrid.py "model=lt.*/VC.*/.*/((C*)|(P*)|(I*))" \
cols=IP,CCG,PNV rows=LT01,LT02 \
others=False rowframe=True colframe=False
-"""
+ """
)
exit()
diff --git a/lib/taurus/qt/qtgui/table/taurustable.py b/lib/taurus/qt/qtgui/table/taurustable.py
index a70714f3..f50200d0 100644
--- a/lib/taurus/qt/qtgui/table/taurustable.py
+++ b/lib/taurus/qt/qtgui/table/taurustable.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides a base widget that can be used to display a taurus
-model in a table widget"""
+model in a table widget
+"""
from taurus.qt.qtgui.model import TaurusBaseModelWidget
from .qtable import QBaseTableWidget
@@ -40,7 +41,8 @@ class TaurusBaseTableWidget(QBaseTableWidget, TaurusBaseModelWidget):
taurus model.
Filters can be inserted into this widget to restrict the items that are
- seen."""
+ seen.
+ """
def __init__(
self,
diff --git a/lib/taurus/qt/qtgui/table/taurusvaluestable.py b/lib/taurus/qt/qtgui/table/taurusvaluestable.py
index ad3811de..73d73f2f 100644
--- a/lib/taurus/qt/qtgui/table/taurusvaluestable.py
+++ b/lib/taurus/qt/qtgui/table/taurusvaluestable.py
@@ -50,10 +50,12 @@ def _value2Quantity(value, units):
"""
Creates a Quantity from value and forces units if the vaule is unitless
- :param value: (int, float or str) a number or a string from which a quantity
- can be created
- :param units: (str or Pint units) Units to use if the value is unitless
- :return: (Quantity)
+ :param value: a number or a string from which a quantity can be created
+ :type value: int, float or str
+ :param units: Units to use if the value is unitless
+ :type units: str or Pint units
+ :return:
+ :rtype: Quantity
"""
q = Quantity(value)
if q.unitless:
@@ -198,7 +200,8 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
Updated the internal table data from an attribute value
- :param attr: (DeviceAttribute)
+ :param attr:
+ :type attr: DeviceAttribute
"""
self._attr = attr
rvalue = attr.rvalue
@@ -234,7 +237,8 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
Returns Status of the variable
- :returns: (taurus.core.taurusbasetypes.AttrQuality)
+ :return:
+ :rtype: taurus.core.taurusbasetypes.AttrQuality
"""
return self._attr.quality
@@ -242,15 +246,18 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
Returns the table data type.
- :returns: (numpy.dtype)
+ :return:
+ :rtype: numpy.dtype
"""
return self._rtabledata.dtype
def addValue(self, index, value):
"""adds a value to the dictionary of modified cell values
- :param index: (QModelIndex) table index
- :param value: (object)
+ :param index: table index
+ :type index: QModelIndex
+ :param value:
+ :type value: object
"""
rtable_value = self._rtabledata[index.row()][index.column()]
if self._attr.getType() in [DataType.Float, DataType.Integer]:
@@ -268,7 +275,8 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
Removes index from dictionary
- :param index: (QModelIndex) table index
+ :param index: table index
+ :type index: QModelIndex
"""
if (index.row(), index.column()) in self._modifiedDict:
self._modifiedDict.pop((index.row(), index.column()))
@@ -292,7 +300,8 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
returns an array for the write data that includes the user modifications
- :return: (numpy.array) The write values including user modifications.
+ :return: The write values including user modifications.
+ :rtype: numpy.array
"""
table = self._wtabledata
kind = table.dtype.kind
@@ -333,9 +342,9 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
Checkes if value is in alarm range.
- :param value: Quantity value
- :returns: (bool) True if value in alarm range, False if valid
-
+ :param value: Quantity value
+ :return: True if value in alarm range, False if valid
+ :rtype: bool
"""
try:
min_alarm, max_alarm = self._attr.alarms
@@ -350,9 +359,9 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
Checks if value is in range.
- :param value: Quantity value
- :returns: (bool) True if value in range, False if valid
-
+ :param value: Quantity value
+ :return: True if value in range, False if valid
+ :rtype: bool
"""
try:
min_range, max_range = self._attr.range
@@ -366,7 +375,8 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
def setWriteMode(self, isWrite):
"""Changes the write state
- :param isWrite: (bool)
+ :param isWrite:
+ :type isWrite: bool
"""
self._writeMode = isWrite
if isWrite and not self.isDirty() and self._attr is not None:
@@ -409,7 +419,8 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
Returns dictionary.
- :returns: (dictionary) dictionary containing modified indexes and values
+ :return: dictionary containing modified indexes and values
+ :rtype: dictionary
"""
return self._modifiedDict
@@ -417,8 +428,10 @@ class TaurusValuesIOTableModel(Qt.QAbstractTableModel):
"""
Returns read value for a given index.
- :param index: (QModelIndex) table model index
- :returns: (string/int/float/bool) read table value for a given cell
+ :param index: table model index
+ :type index: QModelIndex
+ :return: read table value for a given cell
+ :rtype: string/int/float/bool
"""
return self._rtabledata[index.row(), index.column()]
@@ -444,8 +457,8 @@ class TaurusValuesIOTable(Qt.QTableView):
"""
Creates an instance of QTableModel and sets a QT model.
- :param shape: (tuple<int>) shape of the model table to be set
-
+ :param shape: shape of the model table to be set
+ :type shape: tuple<int>
"""
qmodel = TaurusValuesIOTableModel(shape, parent=self)
Qt.QTableView.setModel(self, qmodel)
@@ -629,7 +642,8 @@ class TableInlineEdit(Qt.QLineEdit):
def __decimalDigits(self, fmt):
"""returns the number of decimal digits from a format string
- (or None if they are not defined)"""
+ (or None if they are not defined)
+ """
try:
if fmt[-1].lower() in ["f", "g"] and "." in fmt:
return int(fmt[:-1].split(".")[-1])
@@ -870,14 +884,17 @@ class TaurusValuesTable(TaurusWidget):
def getWriteMode(self):
"""whether the widget is showing the read or write values
- :return: (bool)"""
+ :return:
+ :rtype: bool
+ """
return self._writeMode
def setWriteMode(self, isWrite):
"""
Triggered when the read mode is changed to write mode.
- :param isWrite: (bool)
+ :param isWrite:
+ :type isWrite: bool
"""
self._applyBT.setVisible(isWrite)
self._cancelBT.setVisible(isWrite)
diff --git a/lib/taurus/qt/qtgui/taurusgui/__init__.py b/lib/taurus/qt/qtgui/taurusgui/__init__.py
index 71e68e63..878dd9fc 100644
--- a/lib/taurus/qt/qtgui/taurusgui/__init__.py
+++ b/lib/taurus/qt/qtgui/taurusgui/__init__.py
@@ -47,7 +47,6 @@ line::
This line indicates that `config.xml` should also be used as a source of
configuration options (in case of conflict, the options set in `config.py`
prevail).
-
"""
from .paneldescriptionwizard import *
diff --git a/lib/taurus/qt/qtgui/taurusgui/appsettingswizard.py b/lib/taurus/qt/qtgui/taurusgui/appsettingswizard.py
index 0f9aaa09..db09c260 100644
--- a/lib/taurus/qt/qtgui/taurusgui/appsettingswizard.py
+++ b/lib/taurus/qt/qtgui/taurusgui/appsettingswizard.py
@@ -117,7 +117,8 @@ class BasePage(Qt.QWizardPage):
def fromXml(self, xml):
"""
- :param xml: (etree.Element) root node
+ :param xml: root node
+ :type xml: etree.Element
"""
pass
@@ -1669,7 +1670,8 @@ class AppSettingsWizard(Qt.QWizard):
def getValueFromNode(rootNode, nodeName, default=None):
"""
returns a value from given Node
- :param rootNode: (etree.Element) root node
+ :param rootNode: root node
+ :type rootNode: etree.Element
:param nodeName: the name of node to find
:param default: returned value if node is None or contains empty string
"""
@@ -1683,7 +1685,8 @@ class AppSettingsWizard(Qt.QWizard):
def getArrayFromNode(rootNode, nodeName, default=None):
"""
returns an array contained by given Node
- :param rootNode: (etree.Element) root node
+ :param rootNode: root node
+ :type rootNode: etree.Element
:param nodeName: the name of node to find
:param default: returned value if node is None or contains empty string
"""
@@ -1701,7 +1704,8 @@ class AppSettingsWizard(Qt.QWizard):
parses xml code and sets all pages according to its contents. It
raises an exception if something could not be processed
- :param fname: (unicode) path to file containing xml code
+ :param fname: path to file containing xml code
+ :type fname: unicode
"""
projectDir, cfgfile = os.path.split(fname)
f = open(fname, "r")
@@ -1808,9 +1812,10 @@ class AppSettingsWizard(Qt.QWizard):
"""returns the xml code corresponding to the options selected in the wizard
and a dictionary representing the paths that have been substituted.
- :return: (str, dict<str,str>) The return value is a tuple whose first element
- is the xml code and the second element is a dict where the keys are the
- destination files and the values are the original paths.
+ :return: The return value is a tuple whose first element is the xml
+ code and the second element is a dict where the keys are the
+ destination files and the values are the original paths.
+ :rtype: str, dict<str,str>
"""
root = etree.Element("taurusgui_config")
# general settings page
diff --git a/lib/taurus/qt/qtgui/taurusgui/conf/__init__.py b/lib/taurus/qt/qtgui/taurusgui/conf/__init__.py
index fc6a43b1..7ba570d7 100644
--- a/lib/taurus/qt/qtgui/taurusgui/conf/__init__.py
+++ b/lib/taurus/qt/qtgui/taurusgui/conf/__init__.py
@@ -23,6 +23,7 @@
##
###########################################################################
-"""This package provides configurations for specific GUIs based on TaurusGui"""
+"""This package provides configurations for specific GUIs based on TaurusGui
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/taurusgui/conf/gui_noconf.py b/lib/taurus/qt/qtgui/taurusgui/conf/gui_noconf.py
index 422b12ca..1dd17e6b 100644
--- a/lib/taurus/qt/qtgui/taurusgui/conf/gui_noconf.py
+++ b/lib/taurus/qt/qtgui/taurusgui/conf/gui_noconf.py
@@ -25,7 +25,8 @@
"""An example of usage of TaurusGui in which no configuration file is used
(everything is done programmatically)
-This can be launched directly as a stand-alone python script"""
+This can be launched directly as a stand-alone python script
+"""
if __name__ == "__main__":
from taurus.qt.qtgui.application import TaurusApplication
diff --git a/lib/taurus/qt/qtgui/taurusgui/conf/gui_pureconf.py b/lib/taurus/qt/qtgui/taurusgui/conf/gui_pureconf.py
index 7143dd14..5dddec9d 100644
--- a/lib/taurus/qt/qtgui/taurusgui/conf/gui_pureconf.py
+++ b/lib/taurus/qt/qtgui/taurusgui/conf/gui_pureconf.py
@@ -27,7 +27,8 @@
declarative configuration file that should be interpreted by the tarusgui
script by running `taurusgui gui_pureconf` (if gui_pureconf.py is in the
PYTHONPATH) or `taurusgui <full_path_to_gui_pureconf.py>` (if it is not
-in the PYTHONPATH)"""
+in the PYTHONPATH)
+"""
from taurus.qt.qtgui.taurusgui.utils import PanelDescription
diff --git a/lib/taurus/qt/qtgui/taurusgui/conf/gui_selfconf.py b/lib/taurus/qt/qtgui/taurusgui/conf/gui_selfconf.py
index 80668707..c561d409 100644
--- a/lib/taurus/qt/qtgui/taurusgui/conf/gui_selfconf.py
+++ b/lib/taurus/qt/qtgui/taurusgui/conf/gui_selfconf.py
@@ -25,7 +25,8 @@
"""An example of usage of TaurusGui in which the specific GUI is set up both
programmatically and using the same file as the configuration file.
-This can be launched directly as a stand-alone python script"""
+This can be launched directly as a stand-alone python script
+"""
GUI_NAME = "MyGui"
diff --git a/lib/taurus/qt/qtgui/taurusgui/paneldescriptionwizard.py b/lib/taurus/qt/qtgui/taurusgui/paneldescriptionwizard.py
index 3207950b..55db3d54 100644
--- a/lib/taurus/qt/qtgui/taurusgui/paneldescriptionwizard.py
+++ b/lib/taurus/qt/qtgui/taurusgui/paneldescriptionwizard.py
@@ -684,14 +684,16 @@ class PanelDescriptionWizard(Qt.QWizard, TaurusBaseWidget):
def getPanelDescription(self):
"""Returns the panel description with the choices made so far
- :return: (PanelDescription) the panel description
+ :return: the panel description
+ :rtype: PanelDescription
"""
return self._panelDescription
def setPanelDescription(self, desc):
"""Sets the Panel description
- :param desc: (PanelDescription)
+ :param desc:
+ :type desc: PanelDescription
"""
self._panelDescription = desc
@@ -701,9 +703,10 @@ class PanelDescriptionWizard(Qt.QWizard, TaurusBaseWidget):
:param parent: parent widget for the new dialog
- :return: (tuple<PanelDescription,bool>) tuple of a description object
- and a state flag. The state is True if the dialog was accepted
- and False otherwise
+
+ :return: tuple of a description object and a state flag. The state is
+ True if the dialog was accepted and False otherwise
+ :rtype: tuple<PanelDescription,bool>
"""
dlg = PanelDescriptionWizard(parent, extraWidgets=extraWidgets)
dlg.exec_()
diff --git a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py
index 5c6c8fa6..c8127e01 100644
--- a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py
+++ b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py
@@ -23,7 +23,8 @@
##
###########################################################################
-"""This package provides the TaurusGui class"""
+"""This package provides the TaurusGui class
+"""
import os
import sys
@@ -61,7 +62,8 @@ __docformat__ = "restructuredtext"
@UILoadable(with_ui="ui")
class AssociationDialog(Qt.QDialog):
"""A dialog for viewing and editing the associations between instruments
- and panels"""
+ and panels
+ """
def __init__(self, parent, flags=None):
if flags is None:
@@ -286,7 +288,6 @@ class TaurusGui(TaurusMainWindow):
gui.createPanel(panel, 'Foo') # <-- programmatic!
gui.show()
app.exec_()
-
"""
SelectedInstrument = Qt.pyqtSignal("QString")
@@ -602,9 +603,9 @@ class TaurusGui(TaurusMainWindow):
def removeExternalApp(self, name=None):
"""Remove the given external application from the GUI.
- :param name: (str or None) the name of the external application to be
- removed
- If None given, the user will be prompted
+ :param name: the name of the external application to be removed If None
+ given, the user will be prompted
+ :type name: str or None
"""
apps = list(self.__external_app.keys()) + self.__permanent_ext_apps
if name is None:
@@ -642,9 +643,11 @@ class TaurusGui(TaurusMainWindow):
Sets the widget map that is used application-wide. This widget map will
be used by default in all TaurusForm Panels belonging to this gui.
- :param map: (dict<str,Qt.QWidget>) a dictionary whose keys are device
- type strings (e.g. see :class:`PyTango.DeviceInfo`) and
- whose values are widgets to be used
+ :param map: a dictionary whose keys are device type strings (e.g. see
+ :class:`PyTango.DeviceInfo`) and whose values are widgets to be
+ used
+ :type map: dict<str,Qt.QWidget>
+
.. seealso:: :meth:`TaurusForm.setCustomWidgetMap`, :meth:`getCustomWidgetMap`
"""
@@ -656,9 +659,11 @@ class TaurusGui(TaurusMainWindow):
Returns the default map used to create custom widgets by the TaurusForms
belonging to this GUI
- :return: (dict<str,Qt.QWidget>) a dictionary whose keys are device
- type strings (i.e. see :class:`PyTango.DeviceInfo`) and whose
- values are widgets to be used
+ :return: a dictionary whose keys are device type strings (i.e. see
+ :class:`PyTango.DeviceInfo`) and whose values are widgets to be
+ used
+ :rtype: dict<str,Qt.QWidget>
+
.. seealso:: :meth:`setCustomWidgetMap`
"""
@@ -678,8 +683,9 @@ class TaurusGui(TaurusMainWindow):
If the panel is saved in other perspectives, it should be removed from
them as well.
- :param name: (str or None) the name of the panel to be removed
- If None given, the user will be prompted
+ :param name: the name of the panel to be removed If None given, the
+ user will be prompted
+ :type name: str or None
"""
if name is None:
items = sorted(
@@ -735,16 +741,32 @@ class TaurusGui(TaurusMainWindow):
"""
Creates a panel containing the given widget.
- :param wiget: (QWidget) the widget to be contained in the panel
- :param name: (str) the name of the panel. It will be used in tabs as well as for configuration
- :param floating: (bool) whether the panel should be docked or floating. (see note below)
- :param registerconfig: (bool) if True, the panel will be registered as a delegate for configuration
- :param custom: (bool) if True the panel is to be considered a "custom panel"
- :param permanent: (bool) set this to True for panels that need to be recreated when restoring the app
- :param icon: (QIcon) icon for the panel
- :param instrumentkey: (str) name of an instrument to which this panel is to be associated
+ :param wiget: the widget to be contained in the panel
+ :type wiget: QWidget
+ :param name: the name of the panel. It will be used in tabs as well as
+ for configuration
+ :type name: str
+ :param floating: whether the panel should be docked or floating. (see
+ note below)
+ :type floating: bool
+ :param registerconfig: if True, the panel will be registered as a
+ delegate for configuration
+ :type registerconfig: bool
+ :param custom: if True the panel is to be considered a "custom panel"
+ :type custom: bool
+ :param permanent: set this to True for panels that need to be recreated
+ when restoring the app
+ :type permanent: bool
+ :param icon: icon for the panel
+ :type icon: QIcon
+ :param instrumentkey: name of an instrument to which this panel is to
+ be associated
+ :type instrumentkey: str
+
+
+ :return: the created panel
+ :rtype: DockWidgetPanel
- :return: (DockWidgetPanel) the created panel
.. note:: On a previous version, there was a mandatory parameter called
`area` (which accepted a Qt.DockWidgetArea or None as values)
@@ -810,21 +832,24 @@ class TaurusGui(TaurusMainWindow):
def getPanel(self, name):
"""get a panel object by name
- :return: (DockWidgetPanel)
+ :return:
+ :rtype: DockWidgetPanel
"""
return self.__panels[str(name)]
def getPanelNames(self):
"""returns the names of existing panels
- :return: (list<str>)
+ :return:
+ :rtype: list<str>
"""
return copy.deepcopy(list(self.__panels.keys()))
def _setPermanentExternalApps(self, permExternalApps):
"""creates empty panels for restoring custom panels.
- :param permCustomPanels: (list<str>) list of names of custom panels
+ :param permCustomPanels: list of names of custom panels
+ :type permCustomPanels: list<str>
"""
# first create the panels if they don't actually exist
for name in permExternalApps:
@@ -840,7 +865,8 @@ class TaurusGui(TaurusMainWindow):
def _setPermanentCustomPanels(self, permCustomPanels):
"""creates empty panels for restoring custom panels.
- :param permCustomPanels: (list<str>) list of names of custom panels
+ :param permCustomPanels: list of names of custom panels
+ :type permCustomPanels: list<str>
"""
# first create the panels if they don't actually exist
for name in permCustomPanels:
@@ -853,7 +879,8 @@ class TaurusGui(TaurusMainWindow):
are True (i.e., those custom panels that should be stored in
configuration and/or perspectives)
- :return: (list<str>)
+ :return:
+ :rtype: list<str>
"""
return [
n
@@ -866,7 +893,9 @@ class TaurusGui(TaurusMainWindow):
Shows a dialog for selecting which custom panels should be permanently
stored in the configuration.
- :param showAlways: (bool) forces showing the dialog even if there are no new custom Panels
+ :param showAlways: forces showing the dialog even if there are no new
+ custom Panels
+ :type showAlways: bool
"""
# check if there are some newly created panels that may be made
# permanent
@@ -905,7 +934,8 @@ class TaurusGui(TaurusMainWindow):
Shows a dialog for selecting which new externals applications
should be permanently stored in the configuration.
- :param showAlways: (bool) forces showing the dialog
+ :param showAlways: forces showing the dialog
+ :type showAlways: bool
"""
# check if there are some newly created external applications that may
# be made permanent
@@ -939,7 +969,9 @@ class TaurusGui(TaurusMainWindow):
"""
Creates a panel from a Panel Description and sets it as "custom panel".
- :param paneldesc: (PanelDescription) description of the panel to be created
+ :param paneldesc: description of the panel to be created
+ :type paneldesc: PanelDescription
+
.. seealso:: :meth:`createPanel`
"""
@@ -1066,7 +1098,8 @@ class TaurusGui(TaurusMainWindow):
from the Pool. Each panel is a TaurusForm grouping together all those
elements that belong to the same instrument according to the Pool info
- :return: (list<PanelDescription>)
+ :return:
+ :rtype: list<PanelDescription>
"""
instrument_dict = {}
try:
@@ -1170,17 +1203,14 @@ class TaurusGui(TaurusMainWindow):
def loadConfiguration(self, confname):
"""Reads a configuration file
- :param confname: (str or None) the name of module located in the
- PYTHONPATH or in the conf subdirectory of the directory
- in which taurusgui.py file is installed.
- This method will try to import <confname>.
- If that fails, it will try to import
- `tgconf_<confname>`.
- Alternatively, `confname` can be the path to the
- configuration module (not necessarily in the
- PYTHONPATH).
- `confname` can also be None, in which case a dummy
- empty module will be used.
+ :param confname: the name of module located in the PYTHONPATH or in
+ the conf subdirectory of the directory in which taurusgui.py file
+ is installed. This method will try to import <confname>. If that
+ fails, it will try to import `tgconf_<confname>`. Alternatively,
+ `confname` can be the path to the configuration module (not
+ necessarily in the PYTHONPATH). `confname` can also be None, in
+ which case a dummy empty module will be used.
+ :type confname: str or None
"""
# import the python config file
@@ -1824,7 +1854,8 @@ class TaurusGui(TaurusMainWindow):
"""Slot to be called when there is a new short message. Currently, the only action
taken when there is a new message is to display it in the main window status bar.
- :param msg: (str) the short descriptive message to be handled
+ :param msg: the short descriptive message to be handled
+ :type msg: str
"""
self.statusBar().showMessage(msg)
@@ -1853,9 +1884,13 @@ class TaurusGui(TaurusMainWindow):
"""
Returns the panel name associated to an instrument name
- :param instrumentname: (str or None) The name of the instrument whose associated panel is wanted
+ :param instrumentname: The name of the instrument whose associated
+ panel is wanted
+ :type instrumentname: str or None
+
- :return: (str or None) the associated panel name (or None).
+ :return: the associated panel name (or None).
+ :rtype: str or None
"""
return self.__instrumentToPanelMap.get(instrumentname, None)
@@ -1863,10 +1898,11 @@ class TaurusGui(TaurusMainWindow):
"""
Sets the panel name associated to an instrument
- :param instrumentname: (str) The name of the instrument
- :param panelname: (str or None) The name of the associated
- panel or None to remove the association
- for this instrument.
+ :param instrumentname: The name of the instrument
+ :type instrumentname: str
+ :param panelname: The name of the associated panel or None to remove
+ the association for this instrument.
+ :type panelname: str or None
"""
instrumentname = str(instrumentname)
# remove a previous association if it exists
@@ -1882,8 +1918,9 @@ class TaurusGui(TaurusMainWindow):
"""
Returns the dictionary of instrument-panel associations
- :return: (dict<str,str>) a dict whose keys are the instruments known to the gui
- and whose values are the corresponding associated panels (or None).
+ :return: a dict whose keys are the instruments known to the gui and
+ whose values are the corresponding associated panels (or None).
+ :rtype: dict<str,str>
"""
return copy.deepcopy(self.__instrumentToPanelMap)
@@ -1894,11 +1931,13 @@ class TaurusGui(TaurusMainWindow):
Sets the dictionary of instrument-panel associations.
By default, it keeps any existing association not present in the associationsdict.
- :param associationsdict: (dict<str,str>) a dict whose keys are the instruments names
- and whose values are the corresponding associated panels (or None)
- :param clearExisting: (bool) if True, the the existing asociations are cleared.
- If False (default) existing associations are
- updated with those in associationsdict
+ :param associationsdict: a dict whose keys are the instruments names
+ and whose values are the corresponding associated panels (or None)
+ :type associationsdict: dict<str,str>
+ :param clearExisting: if True, the the existing asociations are
+ cleared. If False (default) existing associations are updated with
+ those in associationsdict
+ :type clearExisting: bool
"""
if clearExisting:
self.__instrumentToPanelMap = copy.deepcopy(associationsdict)
@@ -1919,7 +1958,8 @@ class TaurusGui(TaurusMainWindow):
"""Slot to be called when the selected instrument has changed (e.g. by user
clicking in the synoptic)
- :param instrumentname: (str) The name that identifies the instrument.
+ :param instrumentname: The name that identifies the instrument.
+ :type instrumentname: str
"""
instrumentname = str(instrumentname)
panelname = self.getInstrumentAssociation(instrumentname)
@@ -1928,8 +1968,9 @@ class TaurusGui(TaurusMainWindow):
def setFocusToPanel(self, panelname):
"""Method that sets a focus for panel passed via an argument
- :param panelname: (str) The name that identifies the panel.
- This name must be unique within the panels in the GUI.
+ :param panelname: The name that identifies the panel. This name must be
+ unique within the panels in the GUI.
+ :type panelname: str
"""
panelname = str(panelname)
try:
@@ -1943,7 +1984,9 @@ class TaurusGui(TaurusMainWindow):
def tabifyArea(self, area):
"""tabifies all panels in a given area.
- :param area: (Qt.DockWidgetArea)
+ :param area:
+ :type area: Qt.DockWidgetArea
+
.. warning:: This method is deprecated
"""
@@ -1961,10 +2004,12 @@ class TaurusGui(TaurusMainWindow):
def findPanelsInArea(self, area):
"""returns all panels in the given area
- :param area: (QMdiArea, Qt.DockWidgetArea, 'FLOATING' or None). If
- area=='FLOATING', the dockwidgets that are floating will be
- returned.
- :param area: (Qt.DockWidgetArea or str )
+ :param area: If area=='FLOATING', the dockwidgets that are floating
+ will be returned.
+ :type area: QMdiArea, Qt.DockWidgetArea, 'FLOATING' or None
+ :param area:
+ :type area: Qt.DockWidgetArea or str
+
.. warning:: This method is deprecated
"""
diff --git a/lib/taurus/qt/qtgui/taurusgui/test/res/conf.py b/lib/taurus/qt/qtgui/taurusgui/test/res/conf.py
index 77bd810b..d7fb40d9 100644
--- a/lib/taurus/qt/qtgui/taurusgui/test/res/conf.py
+++ b/lib/taurus/qt/qtgui/taurusgui/test/res/conf.py
@@ -1,4 +1,5 @@
-"""TaurusGui configuration file for tests"""
+"""TaurusGui configuration file for tests
+"""
from taurus.qt.qtgui.taurusgui import utils
diff --git a/lib/taurus/qt/qtgui/taurusgui/utils.py b/lib/taurus/qt/qtgui/taurusgui/utils.py
index f84404f5..f3d8b440 100644
--- a/lib/taurus/qt/qtgui/taurusgui/utils.py
+++ b/lib/taurus/qt/qtgui/taurusgui/utils.py
@@ -24,7 +24,8 @@
###########################################################################
"""This configuration contains base modules and classes that may be used
-by specific TaurusGui-based GUIs"""
+by specific TaurusGui-based GUIs
+"""
from lxml import etree
@@ -70,7 +71,8 @@ class ExternalApp(object):
Returns a :class:`ExternalAppAction` with the values used when
initializing this ExternalApp instance
- :return: (ExternalAppAction)
+ :return:
+ :rtype: ExternalAppAction
"""
return ExternalAppAction(*self.args, **self.kwargs)
@@ -78,10 +80,13 @@ class ExternalApp(object):
def fromXml(xmlstring):
"""returns a ExternalApp object based on the xml string provided
- :param xmlstring: (unicode) XML code defining the values for the
- cmdargs, text, icon and parent variables
+ :param xmlstring: XML code defining the values for the cmdargs, text,
+ icon and parent variables
+ :type xmlstring: unicode
- :return: (ExternalApp) an instance of ExternalApp
+
+ :return: an instance of ExternalApp
+ :rtype: ExternalApp
"""
try:
root = etree.fromstring(xmlstring)
@@ -217,11 +222,17 @@ class TaurusGuiComponentDescription(object):
def getWidget(self, sdm=None, setModel=True):
"""Returns the widget to be inserted in the panel
- :param sdm: (SharedDataManager) if given, the widget will be registered as reader
- and/or writer in this manager as defined by the sharedDataRead and sharedDataWrite properties
- :param setModel: (bool) if True (default) the widget will be given the model deined in the model property
+ :param sdm: if given, the widget will be registered as reader and/or
+ writer in this manager as defined by the sharedDataRead and
+ sharedDataWrite properties
+ :type sdm: SharedDataManager
+ :param setModel: if True (default) the widget will be given the model
+ deined in the model property
+ :type setModel: bool
+
- :return: (QWidget) a new widget instance matching the description
+ :return: a new widget instance matching the description
+ :rtype: QWidget
"""
# instantiate the widget
if self.modulename is None:
@@ -286,10 +297,13 @@ class TaurusGuiComponentDescription(object):
def fromXml(xmlstring):
"""returns a PanelDescription object based on the xml string provided
- :param xmlstring: (unicode) XML code defining the values for the args
- needed to initialize PanelDescription.
+ :param xmlstring: XML code defining the values for the args needed to
+ initialize PanelDescription.
+ :type xmlstring: unicode
- :return: (PanelDescription) object
+
+ :return: object
+ :rtype: PanelDescription
"""
try:
@@ -405,13 +419,17 @@ class PanelDescription(TaurusGuiComponentDescription):
directly passed to the constructor of
:class:`TaurusGuiComponentDescription` )
- :param instrumentkey: (str)
- :param model_in_config: (bool) whther to store model in settigns file or not
- :param modifiable_by_user: (bool) whether user can edit widget or not
- :param widget_formatter: (str) formatter used by this widget
- :param widget_properties: (dict) a dictionary of property_names:values
- to be set on the widget
-
+ :param instrumentkey:
+ :type instrumentkey: str
+ :param model_in_config: whther to store model in settigns file or not
+ :type model_in_config: bool
+ :param modifiable_by_user: whether user can edit widget or not
+ :type modifiable_by_user: bool
+ :param widget_formatter: formatter used by this widget
+ :type widget_formatter: str
+ :param widget_properties: a dictionary of property_names:values to be
+ set on the widget
+ :type widget_properties: dict
"""
self.instrumentkey = kwargs.pop("instrumentkey", None)
self.icon = kwargs.pop("icon", None)
diff --git a/lib/taurus/qt/qtgui/test/base.py b/lib/taurus/qt/qtgui/test/base.py
index b3068914..97b2c1c7 100644
--- a/lib/taurus/qt/qtgui/test/base.py
+++ b/lib/taurus/qt/qtgui/test/base.py
@@ -23,7 +23,8 @@
#############################################################################
-"""Utilities for creating generic tests for Taurus widgets"""
+"""Utilities for creating generic tests for Taurus widgets
+"""
import time
import taurus.core
@@ -57,7 +58,6 @@ class BaseWidgetTestCase(object):
- A TaurusApplication must be initialized.
- The widget must be instantiated
-
"""
from taurus.core.util import deprecated
@@ -82,7 +82,8 @@ class BaseWidgetTestCase(object):
"""Assertion method that checks that the number of deprecations issued
during the current test is equal to or below a given maximum
- :param maximum: (int) maximum number of deprecation warnings allowed
+ :param maximum: maximum number of deprecation warnings allowed
+ :type maximum: int
"""
deps = self._depCounter.getTotal()
if msg is None:
diff --git a/lib/taurus/qt/qtgui/test/test_widgets_general.py b/lib/taurus/qt/qtgui/test/test_widgets_general.py
index 40eac46a..bdf4e308 100644
--- a/lib/taurus/qt/qtgui/test/test_widgets_general.py
+++ b/lib/taurus/qt/qtgui/test/test_widgets_general.py
@@ -81,7 +81,6 @@ def _expand_strings(prefix, elements, key="*", include_key=False):
assert _expand_strings(
"a", [["*/b", "c"], None, ["*/b", None, "*/d"]]
) == [["a/b", "c"], None, ["a/b", None, "a/d"],]
-
"""
ret = []
diff --git a/lib/taurus/qt/qtgui/tree/__init__.py b/lib/taurus/qt/qtgui/tree/__init__.py
index daec376f..c7a3d834 100644
--- a/lib/taurus/qt/qtgui/tree/__init__.py
+++ b/lib/taurus/qt/qtgui/tree/__init__.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This package provides taurus Qt tree widgets"""
+"""This package provides taurus Qt tree widgets
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/tree/qtree.py b/lib/taurus/qt/qtgui/tree/qtree.py
index 51190d75..64ce26f5 100644
--- a/lib/taurus/qt/qtgui/tree/qtree.py
+++ b/lib/taurus/qt/qtgui/tree/qtree.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides base tree widget"""
+"""This module provides base tree widget
+"""
__all__ = ["QBaseTreeWidget"]
diff --git a/lib/taurus/qt/qtgui/tree/taurusdbtree.py b/lib/taurus/qt/qtgui/tree/taurusdbtree.py
index b3e8f9b0..db4e01c1 100644
--- a/lib/taurus/qt/qtgui/tree/taurusdbtree.py
+++ b/lib/taurus/qt/qtgui/tree/taurusdbtree.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides widgets that display the database in a tree format"""
+"""This module provides widgets that display the database in a tree format
+"""
# todo: tango-centric!!
@@ -116,7 +117,8 @@ class TaurusDbTreeWidget(TaurusBaseTreeWidget):
class _TaurusTreePanel(Qt.QWidget, TaurusBaseWidget):
"""A demonstration panel to show how :class:`taurus.qt.qtcore.TaurusDbBaseModel`
models can interact with several model view widgets like QTreeView,
- QTableView, QListView and QComboBox"""
+ QTableView, QListView and QComboBox
+ """
def __init__(self, parent=None, designMode=False):
"""doc please!"""
@@ -281,7 +283,9 @@ class _TaurusTreePanel(Qt.QWidget, TaurusBaseWidget):
def setModel(self, model):
"""Sets/unsets the model name for this component
- :param model: (str) the new model name"""
+ :param model: the new model name
+ :type model: str
+ """
super(_TaurusTreePanel, self).setModel(model)
self._updateTreeModels()
diff --git a/lib/taurus/qt/qtgui/tree/taurustree.py b/lib/taurus/qt/qtgui/tree/taurustree.py
index 1b1f5966..e0c89827 100644
--- a/lib/taurus/qt/qtgui/tree/taurustree.py
+++ b/lib/taurus/qt/qtgui/tree/taurustree.py
@@ -24,7 +24,8 @@
#############################################################################
"""This module provides a base widget that can be used to display a taurus
-model in a tree widget"""
+model in a tree widget
+"""
from taurus.qt.qtgui.model import TaurusBaseModelWidget
from .qtree import QBaseTreeWidget
@@ -62,5 +63,6 @@ class TaurusBaseTreeWidget(QBaseTreeWidget, TaurusBaseModelWidget):
def updateStyle(self):
"""overwritten from class:`taurus.qt.qtgui.base.TaurusBaseWidget`. It is called when
- the taurus model changes."""
+ the taurus model changes.
+ """
self.resizeColumns()
diff --git a/lib/taurus/qt/qtgui/util/__init__.py b/lib/taurus/qt/qtgui/util/__init__.py
index 00c4268e..da4a7abf 100644
--- a/lib/taurus/qt/qtgui/util/__init__.py
+++ b/lib/taurus/qt/qtgui/util/__init__.py
@@ -24,7 +24,8 @@
#############################################################################
"""This package provides a set of taurus wiget utilities like color management,
-configuration, actions."""
+configuration, actions.
+"""
__docformat__ = "restructuredtext"
diff --git a/lib/taurus/qt/qtgui/util/qdraganddropdebug.py b/lib/taurus/qt/qtgui/util/qdraganddropdebug.py
index 7aeeae48..d4591dea 100644
--- a/lib/taurus/qt/qtgui/util/qdraganddropdebug.py
+++ b/lib/taurus/qt/qtgui/util/qdraganddropdebug.py
@@ -32,7 +32,8 @@ from taurus.external.qt import Qt
class DropDebugger(Qt.QLabel):
"""A simple utility for debugging drag&drop.
This widget will accept drops and show a pop-up with the contents
- of the MIME data passed in the drag&drop"""
+ of the MIME data passed in the drag&drop
+ """
def __init__(self, parent=None):
Qt.QLabel.__init__(self, parent)
diff --git a/lib/taurus/qt/qtgui/util/taurusaction.py b/lib/taurus/qt/qtgui/util/taurusaction.py
index d11f3c61..e26f1f3d 100644
--- a/lib/taurus/qt/qtgui/util/taurusaction.py
+++ b/lib/taurus/qt/qtgui/util/taurusaction.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module is designed to provide a library of taurus Qt actions"""
+"""This module is designed to provide a library of taurus Qt actions
+"""
import os
import xml.dom.minidom
@@ -67,13 +68,18 @@ class ExternalAppAction(Qt.QAction, BaseConfigurableClass):
):
"""creator
- :param cmdargs: (list<str> or str) A list of strings to be passed to
- :meth:`subprocess.Popen` for launching the external
- application. It can also be a single string containing a
- command. See :meth:`setCmdArgs`
- :param text: (str) see :class:`Qt.QAction`
- :param icon: (QIcon or any other object that can be passed to QIcon creator) see :class:`Qt.QAction`
- :param parent: (QObject) The parent object
+ :param cmdargs: A list of strings to be passed to
+ :meth:`subprocess.Popen` for launching the external application. It
+ can also be a single string containing a command. See
+ :meth:`setCmdArgs`
+ :type cmdargs: list<str> or str
+ :param text: see :class:`Qt.QAction`
+ :type text: str
+ :param icon: see :class:`Qt.QAction`
+ :type icon: QIcon or any other object that can be passed to QIcon
+ creator
+ :param parent: The parent object
+ :type parent: QObject
"""
if isinstance(cmdargs, str):
import shlex
@@ -103,10 +109,11 @@ class ExternalAppAction(Qt.QAction, BaseConfigurableClass):
It emits the "cmdArgsChanged" signal with the new cmdArgs list
- :param cmdargs: (list<str> or str) A list of strings to be passed to
- :meth:`subprocess.Popen` for launching the external
- application. It can also be a string containing a
- command, which will be automatically converted to a list
+ :param cmdargs: A list of strings to be passed to
+ :meth:`subprocess.Popen` for launching the external application. It
+ can also be a string containing a command, which will be
+ automatically converted to a list
+ :type cmdargs: list<str> or str
"""
if isinstance(cmdargs, str):
import shlex
@@ -162,7 +169,8 @@ class ExternalAppAction(Qt.QAction, BaseConfigurableClass):
def check(self):
"""Returns True if the application is available for executing
- :return: (bool)
+ :return:
+ :rtype: bool
"""
# raise NotImplementedError #@todo: implement a checker (check if
# self.cmdargs[0] is in the execution path and is executable
diff --git a/lib/taurus/qt/qtgui/util/taurusactionfactory.py b/lib/taurus/qt/qtgui/util/taurusactionfactory.py
index 2d3f013b..1d092a3b 100644
--- a/lib/taurus/qt/qtgui/util/taurusactionfactory.py
+++ b/lib/taurus/qt/qtgui/util/taurusactionfactory.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module is designed to provide a factory class for taurus Qt actions """
+"""This module is designed to provide a factory class for taurus Qt actions
+"""
from taurus.core.util.log import Logger
from taurus.core.util.singleton import Singleton
diff --git a/lib/taurus/qt/qtgui/util/tauruscolor.py b/lib/taurus/qt/qtgui/util/tauruscolor.py
index c96d2fd7..a632e298 100644
--- a/lib/taurus/qt/qtgui/util/tauruscolor.py
+++ b/lib/taurus/qt/qtgui/util/tauruscolor.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides Qt color management for taurus"""
+"""This module provides Qt color management for taurus
+"""
__all__ = [
"QtColorPalette",
diff --git a/lib/taurus/qt/qtgui/util/taurusropepatch.py b/lib/taurus/qt/qtgui/util/taurusropepatch.py
index 472d7d3f..3451fb6b 100644
--- a/lib/taurus/qt/qtgui/util/taurusropepatch.py
+++ b/lib/taurus/qt/qtgui/util/taurusropepatch.py
@@ -24,7 +24,8 @@
#############################################################################
"""[DEPRECATED] Rope patch for better performance.
-Based on spyder.rope_patch"""
+Based on spyder.rope_patch
+"""
__all__ = ["apply"]
diff --git a/lib/taurus/qt/qtgui/util/taurusscreenshot.py b/lib/taurus/qt/qtgui/util/taurusscreenshot.py
index 090c0f0f..f7a95db5 100644
--- a/lib/taurus/qt/qtgui/util/taurusscreenshot.py
+++ b/lib/taurus/qt/qtgui/util/taurusscreenshot.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides Qt color management for taurus"""
+"""This module provides Qt color management for taurus
+"""
__all__ = ["Grabber", "grabWidget"]
@@ -124,9 +125,12 @@ class Grabber(Qt.QObject, Logger):
this method **MUST** be called from the same thread which created
the widget
- :param widget: (Qt.QWidget) the qt widget to be grabbed
- :param fileName: (str) the name of the image file
- :param period: (float) period (seconds)
+ :param widget: the qt widget to be grabbed
+ :type widget: Qt.QWidget
+ :param fileName: the name of the image file
+ :type fileName: str
+ :param period: period (seconds)
+ :type period: float
"""
if period is None:
return Grabber._grabWidget(widget, fileName)
diff --git a/lib/taurus/qt/qtgui/util/tauruswidgetfactory.py b/lib/taurus/qt/qtgui/util/tauruswidgetfactory.py
index 1c5b9f83..f6046d6d 100644
--- a/lib/taurus/qt/qtgui/util/tauruswidgetfactory.py
+++ b/lib/taurus/qt/qtgui/util/tauruswidgetfactory.py
@@ -61,8 +61,9 @@ def getWidgetsOfType(widget, class_or_type_or_tuple):
:type class-or-type-or-tuple: type class or a tuple of type classes
:return: a sequence containning all widgets in the hierarchy that match the
- given type
- :rtype: seq<Qt.QWidget>"""
+ given type
+ :rtype: seq<Qt.QWidget>
+ """
widgets = []
_getWidgetsOfType(widget, widgets, class_or_type_or_tuple)
return widgets
diff --git a/lib/taurus/qt/qtgui/util/test/__init__.py b/lib/taurus/qt/qtgui/util/test/__init__.py
index 856a864d..fb8468e2 100644
--- a/lib/taurus/qt/qtgui/util/test/__init__.py
+++ b/lib/taurus/qt/qtgui/util/test/__init__.py
@@ -23,4 +23,5 @@
##
#############################################################################
-"""tests for taurus.qt.qtgui.util"""
+"""tests for taurus.qt.qtgui.util
+"""
diff --git a/lib/taurus/qt/qtgui/util/test/test_ui/__init__.py b/lib/taurus/qt/qtgui/util/test/test_ui/__init__.py
index 6f675253..bed30f62 100644
--- a/lib/taurus/qt/qtgui/util/test/test_ui/__init__.py
+++ b/lib/taurus/qt/qtgui/util/test/test_ui/__init__.py
@@ -24,6 +24,7 @@
#############################################################################
"""This package provides a set of taurus wiget utilities like color management,
-configuration, actions."""
+configuration, actions.
+"""
from .test_ui import *
diff --git a/lib/taurus/qt/qtgui/util/test/test_ui/test_ui.py b/lib/taurus/qt/qtgui/util/test/test_ui/test_ui.py
index e3bd7c6b..81b16fd0 100644
--- a/lib/taurus/qt/qtgui/util/test/test_ui/test_ui.py
+++ b/lib/taurus/qt/qtgui/util/test/test_ui/test_ui.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Unit tests for UILoadable decorator"""
+"""Unit tests for UILoadable decorator
+"""
import os.path
diff --git a/lib/taurus/qt/qtgui/util/ui.py b/lib/taurus/qt/qtgui/util/ui.py
index 0b95f6ce..23119dca 100644
--- a/lib/taurus/qt/qtgui/util/ui.py
+++ b/lib/taurus/qt/qtgui/util/ui.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""utilities to load ui files for widgets"""
+"""utilities to load ui files for widgets
+"""
import os
import sys
@@ -55,15 +56,14 @@ def loadUi(obj, filename=None, path=None, with_ui=None):
the path /home/homer/workspace/taurusgui/ui)
:param filename: the QtDesigner .ui file name [default: None, meaning
- calculate file name with the algorithm explained before]
+ calculate file name with the algorithm explained before]
:type filename: str
- :param path: directory where the QtDesigner .ui file is located
- [default: None, meaning calculate path with algorithm explained
- before]
+ :param path: directory where the QtDesigner .ui file is located [default:
+ None, meaning calculate path with algorithm explained before]
:type path: str
:param with_ui: if True, the objects defined in the ui file will be
- accessible as submembers of an ui member of the widget. If
- False, such objects will directly be members of the widget.
+ accessible as submembers of an ui member of the widget. If False, such
+ objects will directly be members of the widget.
:type with_ui: bool
"""
if path is None:
@@ -129,11 +129,9 @@ def UILoadable(klass=None, with_ui=None):
self.loadUi(filename="superUI.ui", path=os.path.dirname(__file__))
self._ui.my_button.setText("This is MY button")
- :param with_ui: assigns a member to the decorated class from which you
- can access all UI components [default: None, meaning no
- member is created]
+ :param with_ui: assigns a member to the decorated class from which you can
+ access all UI components [default: None, meaning no member is created]
:type with_ui: str
-
"""
if klass is None:
return functools.partial(UILoadable, with_ui=with_ui)
diff --git a/lib/taurus/qt/qtgui/util/validator.py b/lib/taurus/qt/qtgui/util/validator.py
index 1e7b7a79..3328beaa 100644
--- a/lib/taurus/qt/qtgui/util/validator.py
+++ b/lib/taurus/qt/qtgui/util/validator.py
@@ -38,8 +38,8 @@ class PintValidator(Qt.QValidator):
@property
def top(self):
"""
- :return: (Quantity or None) maximum accepted or None if it is not
- enforced
+ :return: maximum accepted or None if it is not enforced
+ :rtype: Quantity or None
"""
return self._top
@@ -47,16 +47,17 @@ class PintValidator(Qt.QValidator):
"""
Set maximum limit
- :param top: (Quantity or None) maximum acceptable value or None if it is
- not to be enforced
+ :param top: maximum acceptable value or None if it is not to be
+ enforced
+ :type top: Quantity or None
"""
self._top = Quantity(top)
@property
def units(self):
"""
- :return: (pint.Unit or None) base units or None if it should not
- be enforced
+ :return: base units or None if it should not be enforced
+ :rtype: pint.Unit or None
"""
return self._implicit_units
@@ -65,18 +66,18 @@ class PintValidator(Qt.QValidator):
Set implicit units. They will be assumed when the text does not explicit
the unit. They will also be used for dimensionality coherence checks.
- :param units: (pint.Unit or None). The implicit unit. If None, implicit
- dimension is "unitless" and no dimensionality checks
- will be performed (other than those inherent to range
- enforcement)
+ :param units: The implicit unit. If None, implicit dimension is
+ "unitless" and no dimensionality checks will be performed (other
+ than those inherent to range enforcement)
+ :type units: pint.Unit or None
"""
self._implicit_units = units
@property
def bottom(self):
"""
- :return: (Quantity or None) minimum accepted or None if it is not
- enforced
+ :return: minimum accepted or None if it is not enforced
+ :rtype: Quantity or None
"""
return self._bottom
@@ -84,8 +85,9 @@ class PintValidator(Qt.QValidator):
"""
Set minimum limit
- :param bottom: (Quantity or None) minimum acceptable value or None if it
- is not to be enforced
+ :param bottom: minimum acceptable value or None if it is not to be
+ enforced
+ :type bottom: Quantity or None
"""
self._bottom = Quantity(bottom)
diff --git a/lib/taurus/test/base.py b/lib/taurus/test/base.py
index dc7a4ff9..99445bcc 100644
--- a/lib/taurus/test/base.py
+++ b/lib/taurus/test/base.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides basic utilities for usage in any test"""
+"""This module provides basic utilities for usage in any test
+"""
__docformat__ = "restructuredtext"
@@ -76,7 +77,6 @@ def insertTest(
class Foo(unittest.TestCase):
def isPositive(self, x):
self.assertTrue(x > 0)
-
"""
# Recipe to support decorating with and without arguments
if klass is None:
diff --git a/lib/taurus/test/fuzzytest.py b/lib/taurus/test/fuzzytest.py
index 1b8522bf..e19b90a2 100644
--- a/lib/taurus/test/fuzzytest.py
+++ b/lib/taurus/test/fuzzytest.py
@@ -23,19 +23,25 @@
##
#############################################################################
-"""Utility functions to deal with non-ideal (fuzzy) tests"""
+"""Utility functions to deal with non-ideal (fuzzy) tests
+"""
def loopTest(testname, maxtries=100, maxfails=10):
"""Run a test `maxtries` times or until it fails `maxfails` times and
report the number of tries and failures.
- :param testname: (str) test name. see:
- :meth:`unittest.TestLoader.loadTestsFromName`
- :param maxtries: (int) maximum number of runs
- :param maxfails: (int) maximum number of failed runs
+ :param testname: test name. see:
+ :meth:`unittest.TestLoader.loadTestsFromName`
+ :type testname: str
+ :param maxtries: maximum number of runs
+ :type maxtries: int
+ :param maxfails: maximum number of failed runs
+ :type maxfails: int
- :return: (tuple) a tuple of ints: tries, failures
+
+ :return: a tuple of ints: tries, failures
+ :rtype: tuple
"""
import unittest
@@ -58,16 +64,24 @@ def loopSubprocess(
The callable is run as a subprocess and it is considered to run fine if
the subprocess exit code is in the okValues list.
- :param target: (callable) a callable test
- :param maxtries: (int) maximum number of runs
- :param maxfails: (int) maximum number of failed runs
- :param okvalues: (seq) a sequence containing exit values of cmd which
- are considered to be successful runs.
- :param args: (seq) arguments for running the target function
- :param kwargs: (dict) keyword arguments for running the target function
+ :param target: a callable test
+ :type target: callable
+ :param maxtries: maximum number of runs
+ :type maxtries: int
+ :param maxfails: maximum number of failed runs
+ :type maxfails: int
+ :param okvalues: a sequence containing exit values of cmd which are
+ considered to be successful runs.
+ :type okvalues: seq
+ :param args: arguments for running the target function
+ :type args: seq
+ :param kwargs: keyword arguments for running the target function
+ :type kwargs: dict
+
- :return: (tuple) a tuple of ints: tries, failures
+ :return: a tuple of ints: tries, failures
+ :rtype: tuple
"""
if kwargs is None:
kwargs = {}
@@ -90,15 +104,19 @@ def calculateTestFuzziness(test, maxtries=100, maxfails=10, **kwargs):
problem and but that the test is not perfect and only fails (triggers the
problem) with a certain failure rate.
- :param testname: (str) test name. see:
- :meth:`unittest.TestLoader.loadTestsFromName`
- :param maxtries: (int) maximum number of runs
- :param maxfails: (int) maximum number of failed runs
+ :param testname: test name. see:
+ :meth:`unittest.TestLoader.loadTestsFromName`
+ :type testname: str
+ :param maxtries: maximum number of runs
+ :type maxtries: int
+ :param maxfails: maximum number of failed runs
+ :type maxfails: int
+
- :return: (tuple) a tuple (f,df,n) where f is the failure rate, df is its
- standard deviation, and n is the number of consecutive
- times that the test should be passed to have a confidence>99%%
- that the bug is fixed'
+ :return: a tuple (f,df,n) where f is the failure rate, df is its standard
+ deviation, and n is the number of consecutive times that the test
+ should be passed to have a confidence>99%% that the bug is fixed'
+ :rtype: tuple
"""
print(
(
diff --git a/lib/taurus/test/moduleexplorer.py b/lib/taurus/test/moduleexplorer.py
index b7cf4508..047655ef 100644
--- a/lib/taurus/test/moduleexplorer.py
+++ b/lib/taurus/test/moduleexplorer.py
@@ -24,7 +24,8 @@
##
###########################################################################
-"""Utility code for returning info about a module"""
+"""Utility code for returning info about a module
+"""
import os
import inspect
@@ -35,11 +36,13 @@ import re
class ModuleExplorer(object):
def __init__(self, exclude_patterns=(), verbose=True):
"""
- :param exclude_patterns: (seq<str>) sequence of strings containing regexp
- patterns. Each candidate to be explored will be
- matched against these patterns and will be excluded
- if it matches any of them.
- :param verbose: (bool) If True (default) status messages will be printed to stdout
+ :param exclude_patterns: sequence of strings containing regexp
+ patterns. Each candidate to be explored will be matched against
+ these patterns and will be excluded if it matches any of them.
+ :type exclude_patterns: seq<str>
+ :param verbose: If True (default) status messages will be printed to
+ stdout
+ :type verbose: bool
"""
self.exclude_patterns = [re.compile(p) for p in exclude_patterns]
self.verbose = verbose
@@ -92,9 +95,11 @@ class ModuleExplorer(object):
:param modulename: the name of the module to explore
- :return: (dict<str,object>) a dictionary containing submodulenames,
- localclassnames, localfunctionnames, localenumerationnames,
- externalmembernames, submodules, warnings
+
+ :return: a dictionary containing submodulenames, localclassnames,
+ localfunctionnames, localenumerationnames, externalmembernames,
+ submodules, warnings
+ :rtype: dict<str,object>
"""
if self.verbose:
print("Exploring %s..." % modulename)
@@ -204,12 +209,18 @@ class ModuleExplorer(object):
"""
append all values for a given key in a nested "moduleinfo" dictionary
- :param info: (dict) a moduleinfo dictionary like the one returned by :meth:`exploreModule`
- :param key: (str) a key of a moduleinfo dictionary
+ :param info: a moduleinfo dictionary like the one returned by
+ :meth:`exploreModule`
+ :type info: dict
+ :param key: a key of a moduleinfo dictionary
+ :type key: str
+
- :return: (list<tuple>) a list that concatenates tuples where the first element is the (sub)module name
- and the second element is the value for the given key.
- If for a certain submodule, the value is empty, it is not included in the list at all.
+ :return: a list that concatenates tuples where the first element is
+ the (sub)module name and the second element is the value for the
+ given key. If for a certain submodule, the value is empty, it is
+ not included in the list at all.
+ :rtype: list<tuple>
"""
mname = info["modulename"]
try:
@@ -228,16 +239,21 @@ class ModuleExplorer(object):
"""convenience to explore a module
:param modulename: the name of the module to explore
- :param exclude_patterns: (seq<str>) sequence of strings containing regexp
- patterns. Each candidate to be explored will be
- matched against these patterns and will be excluded
- if it matches any of them.
- :param verbose: (bool) If True (default) status messages will be printed to stdout
-
- :return: (dict<str,object>, allwarnings) a tuple whose first member is a dictionary
- containing submodulenames, localclassnames, localfunctionnames, localenumerationnames,
- externalmembernames, submodules, warnings. The second member of the tuple is a list
- containing all the warnings accummulated.
+ :param exclude_patterns: sequence of strings containing regexp
+ patterns. Each candidate to be explored will be matched against
+ these patterns and will be excluded if it matches any of them.
+ :type exclude_patterns: seq<str>
+ :param verbose: If True (default) status messages will be printed to
+ stdout
+ :type verbose: bool
+
+
+ :return: a tuple whose first member is a dictionary containing
+ submodulenames, localclassnames, localfunctionnames,
+ localenumerationnames, externalmembernames, submodules, warnings.
+ The second member of the tuple is a list containing all the
+ warnings accummulated.
+ :rtype: dict<str,object>, allwarnings
"""
explorer = ModuleExplorer(
exclude_patterns=exclude_patterns, verbose=verbose
diff --git a/lib/taurus/test/pytest.py b/lib/taurus/test/pytest.py
index 9e900f0a..a88c7fbf 100644
--- a/lib/taurus/test/pytest.py
+++ b/lib/taurus/test/pytest.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""Common tools and fixtures for using with taurus and pytest"""
+"""Common tools and fixtures for using with taurus and pytest
+"""
import pytest
import contextlib
@@ -35,7 +36,8 @@ def check_taurus_deprecations(caplog, expected=0):
"""context manager that checks the number of taurus deprecation warnings
logged within the context execution.
- :param expected: (int) Expected number of deprecations. Default is 0
+ :param expected: Expected number of deprecations. Default is 0
+ :type expected: int
"""
from taurus import tauruscustomsettings
diff --git a/lib/taurus/test/resource.py b/lib/taurus/test/resource.py
index 05da7528..9ba8c617 100644
--- a/lib/taurus/test/resource.py
+++ b/lib/taurus/test/resource.py
@@ -23,7 +23,8 @@
##
###########################################################################
-"""Utility code for working with test resources"""
+"""Utility code for working with test resources
+"""
import os
import sys
@@ -43,13 +44,16 @@ def getResourcePath(resmodule, fname=""):
It raises ImportError if resmodule does not exist and
RuntimeError if fname does not exist)
- :param resmodule: (str) name of a resource module
- :param fname: (str) the name of a resource file present in the
- resmodule directory
+ :param resmodule: name of a resource module
+ :type resmodule: str
+ :param fname: the name of a resource file present in the resmodule
+ directory
+ :type fname: str
- :return: (str) absolute path to the resource file
- (or to the resource directory if fname is not passed)
+ :return: absolute path to the resource file (or to the resource directory
+ if fname is not passed)
+ :rtype: str
"""
__import__(resmodule)
module = sys.modules[resmodule] # We use this because __import__('x.y')
diff --git a/lib/taurus/test/skip.py b/lib/taurus/test/skip.py
index cc566376..012e73e5 100644
--- a/lib/taurus/test/skip.py
+++ b/lib/taurus/test/skip.py
@@ -23,7 +23,8 @@
##
#############################################################################
-"""This module provides utilities for skipping certain sets of tests"""
+"""This module provides utilities for skipping certain sets of tests
+"""
# __all__ = []
@@ -56,7 +57,6 @@ def skipUnlessGui():
Note: using skipUnlessGui is equivalent to:
@skipunless(taurus.test.GUI_TESTS_ENABLED, 'requires GUI')
-
"""
Logger.deprecated(dep="skipUnlessGui", rel="4.0", alt="pytest")
return unittest.skipUnless(GUI_TESTS_ENABLED, "requires GUI")
@@ -66,7 +66,8 @@ def _hasgui():
"""Returns True if GUI is available. False otherwise
The current implementation is not very robust: it just looks for the
'DISPLAY' environment variable on posix systems and assumes True
- for other systems"""
+ for other systems
+ """
import os
if os.name == "posix" and not os.getenv("DISPLAY"):
diff --git a/lib/taurus/test/test_import.py b/lib/taurus/test/test_import.py
index e02a7565..20ec8190 100644
--- a/lib/taurus/test/test_import.py
+++ b/lib/taurus/test/test_import.py
@@ -23,7 +23,8 @@
#############################################################################
-"""Taurus import tests"""
+"""Taurus import tests
+"""
import sys
import unittest