[pytango] 296/483: preparing for 8.1.1
Sandor Bodo-Merle
sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:52 UTC 2017
This is an automated email from the git hooks/post-receive script.
sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.
commit f622b88ff40d986d4b279f064f2753a6de3a5ed5
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date: Wed Nov 13 15:48:47 2013 +0000
preparing for 8.1.1
git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@24191 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
doc/revision.rst | 4 +-
doc/server/hlapi.rst | 213 ++++++++++++++++++++++++++++-
doc/server/index.rst | 85 +-----------
src/boost/cpp/constants.cpp | 3 +-
src/boost/python/hlapi.py | 287 +++++++++------------------------------
src/boost/python/pytango_init.py | 7 +-
src/boost/python/utils.py | 19 +--
7 files changed, 300 insertions(+), 318 deletions(-)
diff --git a/doc/revision.rst b/doc/revision.rst
index d5548d8..4f3bb2a 100644
--- a/doc/revision.rst
+++ b/doc/revision.rst
@@ -84,13 +84,15 @@ Version history
+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| version | Changes |
+==========+===================================================================================================================================================================+
-| 8.1.0 | Features: |
+| 8.1.1 | Features: |
| | - Implemented tango C++ 8.1 API |
| | Bug fixes: |
| | - `573: [pytango] python3 error with unregistered device <https://sourceforge.net/p/tango-cs/bugs/573/>`_ |
| | - `611: URGENT fail to write attribute with PyTango 8.0.3 <https://sourceforge.net/p/tango-cs/bugs/611/>`_ |
| | - `612: [pytango][8.0.3] failed to build from source on s390 <https://sourceforge.net/p/tango-cs/bugs/612/>`_ |
+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| 8.1.0 | *SKIPPED* |
++----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 8.0.3 | Features: |
| | - from sourceforge: |
| | - `88: Implement Util::server_set_event_loop method in python <https://sourceforge.net/p/tango-cs/feature-requests/88>`_ |
diff --git a/doc/server/hlapi.rst b/doc/server/hlapi.rst
index 8182deb..de3cb92 100644
--- a/doc/server/hlapi.rst
+++ b/doc/server/hlapi.rst
@@ -1,5 +1,216 @@
+.. currentmodule:: PyTango.hlapi
+
+.. _pytango-hlapi:
+
HLAPI
------
+=====
+
+The High Level API for writting Tango device servers.
+
+Introduction
+------------
+
+This module provides a high level device server API. It implements
+:ref:`TEP1 <pytango-TEP1>`. It exposes an easier API for developing a Tango
+device server.
+
+Here is the summary of features which this module exposes and are not available
+on the low level :mod:`PyTango` server API:
+
+#. Automatic inheritance from the latest :class:`~PyTango.DeviceImpl`
+#. default implementation of :meth:`Device.__init__`
+ calls :meth:`Device.init_device`. Around 90% of the
+ different device classes which inherit from low level
+ :class:`~PyTango.DeviceImpl` only implement `__init__` to call their
+ `init_device`
+#. has a default implementation of :meth:`Device.init_device`
+ which calls :meth:`Device.get_device_properties`. Again,
+ 90% of existing device classes do that
+#. Automatically creates a hidden :class:`~PyTango.DeviceClass` class
+#. recognizes :func:`attribute` members and automatically
+ registers them as tango attributes in the hidden
+ :class:`~PyTango.DeviceClass`
+#. recognizes :func:`command` decorated functions and
+ automatically registers them as tango commands in the hidden
+ :class:`~PyTango.DeviceClass`
+#. recognizes :func:`device_property` members and
+ automatically registers them as tango device properties in the hidden
+ :class:`~PyTango.DeviceClass`
+#. recognizes :func:`class_property` members and
+ automatically registers them as tango class properties in the hidden
+ :class:`~PyTango.DeviceClass`
+#. read and write attribute methods don't need :class:`~PyTango.Attribute`
+ parameter. Access to :class:`~PyTango.Attribute` object is with simple::
+
+ self.<attr name>
+
+#. read attribute methods can set attribute return value with::
+
+ def read_voltage(self):
+ return value
+
+ # or
+
+ def read_voltage(self):
+ self.voltage = value
+
+ instead of::
+
+ def read_voltage(self, attr):
+ attr.set_value(value)
+
+:class:`Device` works very well in conjuction with:
+
+#. :func:`attribute`
+#. :class:`command`
+#. :meth:`device_property`
+#. :meth:`class_property`
+#. :meth:`~PyTango.server_run`
+
+Here is an example of a PowerSupply device with:
+
+#. a read-only double scalar `voltage` attribute
+#. a read/write double scalar `current` attribute
+#. a `ramp` command
+#. a `host` device property
+
+.. code-block:: python
+ :linenos:
+
+ from time import time
+
+ from PyTango import AttrQuality, DebugIt, server_run
+ from PyTango.hlapi import Device, DeviceMeta
+ from PyTango.hlapi import attribute, command, device_property
+
+ class PowerSupply(Device):
+ __metaclass__ = DeviceMeta
+
+ voltage = attribute()
+
+ current = attribute(label="Current", unit="A",
+ fread="read_current",
+ fwrite="write_current")
+
+ host = device_property()
+
+ def read_voltage(self):
+ return 10.0
+
+ def read_current(self):
+ return 2.5, time(), AttrQuality.ON
+
+ @DebugIt()
+ def write_current(self):
+ new_current = self.current.get_write_value()
+
+ @command()
+ def ramp(self):
+ self.info_stream("Ramping on " + self.host + "...")
+
+ def main():
+ classes = PowerSupply,
+ server_run(classes)
+
+ if __name__ == "__main__":
+ main()
+
+And here is the equivalent code using the low-level API:
+
+.. code-block:: python
+ :linenos:
+
+ import sys
+ import time
+
+ import PyTango
+
+ class PowerSupply(PyTango.Device_4Impl):
+
+ def __init__(self, devclass, name):
+ PyTango.Device_4Impl.__init__(self, devclass, name)
+ self.init_device()
+
+ def init_device(self):
+ self.get_device_properties()
+
+ def read_voltage(self, attr):
+ attr.set_value(10.0)
+
+ def read_current(self):
+ attr.set_value_date_quality(2.5, time.time(), PyTango.AttrQuality.ON)
+
+ @PyTango.DebugIt()
+ def write_current(self, attr):
+ new_current = attr.get_write_value()
+
+ def ramp(self):
+ self.info_stream("Ramping on " + self.host + "...")
+
+
+ class PowerSupplyClass(PyTango.DeviceClass):
+
+ class_property_list = {}
+
+ device_property_list = {
+ 'host':
+ [PyTango.DevString, "host of power supply", "localhost"],
+ }
+
+ cmd_list = {
+ 'ramp':
+ [ [PyTango.DevVoid, "nothing"],
+ [PyTango.DevVoid, "nothing"] ],
+ }
+
+ attr_list = {
+ 'voltage':
+ [[PyTango.DevDouble,
+ PyTango.SCALAR,
+ PyTango.READ]],
+ 'current':
+ [[PyTango.DevDouble,
+ PyTango.SCALAR,
+ PyTango.READ_WRITE],
+ { 'label' : 'Current', 'unit' : 'A' }],
+ }
+
+
+ def main():
+ try:
+ py = PyTango.Util(sys.argv)
+ py.add_class(PowerSupplyClass,PowerSupply,'PowerSupply')
+
+ U = PyTango.Util.instance()
+ U.server_init()
+ U.server_run()
+
+ except PyTango.DevFailed,e:
+ print '-------> Received a DevFailed exception:',e
+ except Exception,e:
+ print '-------> An unforeseen exception occured....',e
+
+ if __name__ == "__main__":
+ main()
+
+
+*Pretty cool, uh?*
+
+API
+---
.. automodule:: PyTango.hlapi
+
+ .. autoclass:: Device
+ :show-inheritance:
+ :inherited-members:
+ :members:
+
+ .. autofunction:: attribute
+
+ .. autofunction:: command
+
+ .. autofunction:: device_property
+
+ .. autofunction:: class_property
diff --git a/doc/server/index.rst b/doc/server/index.rst
index 0402cdc..010645b 100644
--- a/doc/server/index.rst
+++ b/doc/server/index.rst
@@ -184,7 +184,8 @@ array:
+-------------------+-----------------------------------+------------------------------------------+
|"polling period" | Any number | The attribute polling period (mS) |
+-------------------+-----------------------------------+------------------------------------------+
- | "memorized" | True or True_without_hard_applied | Define if and how the att. is memorized |
+ | "memorized" | "true" or | Define if and how the att. is memorized |
+ | | "true_without_hard_applied" | |
+-------------------+-----------------------------------+------------------------------------------+
| "label" | A string | The attribute label |
+-------------------+-----------------------------------+------------------------------------------+
@@ -441,83 +442,9 @@ The *attr* parameter is an instance of :class:`Attr`.
Unlike the commands, the is_allowed method for attributes receives a parameter
of type :class:`AttReqtype`.
-The following table gives information on the mapping between Tango and Python
-data types for attributes:
-
-+-------------+-------------+--------------------------------------------------------------+
-| data format | data type | python type |
-+=============+=============+==============================================================+
-| SCALAR | DEV_BOOLEAN | :py:obj:`bool` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_UCHAR | :py:obj:`int` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_SHORT | :py:obj:`int` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_USHORT | :py:obj:`int` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_LONG | :py:obj:`int` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_ULONG | :py:obj:`int` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_LONG64 | :py:obj:`int`/ :py:obj:`long` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_ULONG64 | :py:obj:`int`/ :py:obj:`long` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_FLOAT | :py:obj:`float` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_DOUBLE | :py:obj:`float` |
-+-------------+-------------+--------------------------------------------------------------+
-| SCALAR | DEV_STRING | :py:obj:`str` |
-+-------------+-------------+--------------------------------------------------------------+
-| SPECTRUM | DEV_BOOLEAN | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.bool`) |
-| or IMAGE | | or sequence<:py:obj:`bool`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_UCHAR | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.uint8`) |
-| | | or sequence<:py:obj:`int`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_SHORT | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.int16`) |
-| | | or sequence<:py:obj:`int`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_USHORT | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.uint16`) |
-| | | or sequence<:py:obj:`int`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_LONG | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.int32`) |
-| | | or sequence<:py:obj:`int`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_ULONG | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.uint32`) |
-| | | or sequence<:py:obj:`int`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_LONG64 | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.int64`) |
-| | | or sequence<:py:obj:`int`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_ULONG64 | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.uint64`) |
-| | | or sequence<:py:obj:`int`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_FLOAT | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.float32`) |
-| | | or sequence<:py:obj:`float`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_DOUBLE | :py:class:`numpy.ndarray` (dtype= :py:obj:`numpy.float64`) |
-| | | or sequence<:py:obj:`float`> |
-+-------------+-------------+--------------------------------------------------------------+
-| | DEV_STRING | sequence<:py:obj:`str`> |
-+-------------+-------------+--------------------------------------------------------------+
-
-For SPECTRUM and IMAGES the actual sequence object used depends on the context
-where the tango data is used, and the availability of :py:mod:`numpy`.
-
-1. for properties the sequence is always a :py:class:`list`. Example:
-
- >>> import PyTango
- >>> db = PyTango.Database()
- >>> s = db.get_property(["TangoSynchrotrons"])
- >>> print type(s)
- <type 'list'>
-
-2. for attribute/command values
- - :py:class:`numpy.ndarray` if PyTango was compiled with :py:mod:`numpy`
- support (default) and :py:mod:`numpy` is installed.
- - :py:class:`list` otherwise
-
+Please check :ref:`pytango-data-types` chapter to understand the data types
+that can be used in attribute.
+
The following code is an example of how you write code executed when a client
read an attribute which is called *Long_attr*::
@@ -686,7 +613,6 @@ creates a device of some arbitrary class (the example assumes the tango commands
with two strings. No error processing was done on the code for simplicity sake)::
class MyDevice(PyTango.Device_4Impl):
- ...
def CreateDevice(self, pars):
klass_name, dev_name = pars
@@ -713,7 +639,6 @@ For example, if you wish to create a clone of your device, you can create a
tango command called Clone::
class MyDevice(PyTango.Device_4Impl):
- ...
def fill_new_device_properties(self, dev_name):
prop_names = db.get_device_property_list(self.get_name(), "*")
diff --git a/src/boost/cpp/constants.cpp b/src/boost/cpp/constants.cpp
index b96e719..ef4b510 100644
--- a/src/boost/cpp/constants.cpp
+++ b/src/boost/cpp/constants.cpp
@@ -12,7 +12,8 @@
#include "precompiled_header.hpp"
#include <tango.h>
-#define TOSTRING(s) #s
+#define _TOSTRING(s) #s
+#define TOSTRING(s) _TOSTRING(s)
using namespace boost::python;
diff --git a/src/boost/python/hlapi.py b/src/boost/python/hlapi.py
index a67d497..7890d42 100644
--- a/src/boost/python/hlapi.py
+++ b/src/boost/python/hlapi.py
@@ -9,194 +9,7 @@
# See LICENSE.txt for more info.
# ------------------------------------------------------------------------------
-""".. _pytango-hlapi:
-
-This module provides a high level device server API. It implements
-:ref:`TEP1 <pytango-TEP1>`. It exposes an easier API for developing a tango
-device server.
-
-Here is the summary of features which this module exposes and are not available
-on the low level :mod:`PyTango` server API:
-
-#. Automatic inheritance from the latest :class:`~PyTango.DeviceImpl`
-#. default implementation of :meth:`Device.__init__`
- calls :meth:`Device.init_device`. Around 90% of the
- different device classes which inherit from low level
- :class:`~PyTango.DeviceImpl` only implement `__init__` to call their
- `init_device`
-#. has a default implementation of :meth:`Device.init_device`
- which calls :meth:`Device.get_device_properties`. Again,
- 90% of existing device classes do that
-#. Automatically creates a hidden :class:`~PyTango.DeviceClass` class
-#. recognizes :func:`attribute` members and automatically
- registers them as tango attributes in the hidden
- :class:`~PyTango.DeviceClass`
-#. recognizes :class:`command` decorated functions and
- automatically registers them as tango commands in the hidden
- :class:`~PyTango.DeviceClass`
-#. recognizes :func:`device_property` members and
- automatically registers them as tango device properties in the hidden
- :class:`~PyTango.DeviceClass`
-#. recognizes :func:`class_property` members and
- automatically registers them as tango class properties in the hidden
- :class:`~PyTango.DeviceClass`
-#. read and write attribute methods don't need :class:`~PyTango.Attribute`
- parameter. Access to :class:`~PyTango.Attribute` object is with simple::
-
- self.<attr name>
-
-#. read attribute methods can set attribute return value with::
-
- def read_voltage(self):
- return value
-
- # or
-
- def read_voltage(self):
- self.voltage = value
-
- instead of::
-
- def read_voltage(self, attr):
- attr.set_value(value)
-
-:class:`Device` works very well in conjuction with:
-
-#. :meth:`attribute`
-#. :class:`command`
-#. :meth:`device_property`
-#. :meth:`class_property`
-#. :meth:`~PyTango.server_run`
-
-Here is an example of a PowerSupply device with:
-
-#. a read-only double scalar `voltage` attribute
-#. a read/write double scalar `current` attribute
-#. a `ramp` command
-#. a `host` device property
-
-.. code-block:: python
- :linenos:
-
- from time import time
-
- from PyTango import AttrQuality, DebugIt, server_run
- from PyTango.hlapi import Device, DeviceMeta
- from PyTango.hlapi import attribute, command, device_property
-
- class PowerSupply(Device):
- __metaclass__ = DeviceMeta
-
- voltage = attribute()
-
- current = attribute(label="Current", unit="A",
- fread="read_current",
- fwrite="write_current")
-
- host = device_property()
-
- def read_voltage(self):
- return 10.0
-
- def read_current(self):
- return 2.5, time(), AttrQuality.ON
-
- @DebugIt()
- def write_current(self):
- new_current = self.current.get_write_value()
-
- @command()
- def ramp(self):
- self.info_stream("Ramping on " + self.host + "...")
-
- def main():
- classes = PowerSupply,
- server_run(classes)
-
- if __name__ == "__main__":
- main()
-
-And here is the equivalent code using the low-level API:
-
-.. code-block:: python
- :linenos:
-
- import sys
- import time
-
- import PyTango
-
- class PowerSupply(PyTango.Device_4Impl):
-
- def __init__(self, devclass, name):
- PyTango.Device_4Impl.__init__(self, devclass, name)
- self.init_device()
-
- def init_device(self):
- self.get_device_properties()
-
- def read_voltage(self, attr):
- attr.set_value(10.0)
-
- def read_current(self):
- attr.set_value_date_quality(2.5, time.time(), PyTango.AttrQuality.ON)
-
- @PyTango.DebugIt()
- def write_current(self, attr):
- new_current = attr.get_write_value()
-
- def ramp(self):
- self.info_stream("Ramping on " + self.host + "...")
-
-
- class PowerSupplyClass(PyTango.DeviceClass):
-
- class_property_list = {}
-
- device_property_list = {
- 'host':
- [PyTango.DevString, "host of power supply", "localhost"],
- }
-
- cmd_list = {
- 'ramp':
- [ [PyTango.DevVoid, "nothing"],
- [PyTango.DevVoid, "nothing"] ],
- }
-
- attr_list = {
- 'voltage':
- [[PyTango.DevDouble,
- PyTango.SCALAR,
- PyTango.READ]],
- 'current':
- [[PyTango.DevDouble,
- PyTango.SCALAR,
- PyTango.READ_WRITE],
- { 'label' : 'Current', 'unit' : 'A' }],
- }
-
-
- def main():
- try:
- py = PyTango.Util(sys.argv)
- py.add_class(PowerSupplyClass,PowerSupply,'PowerSupply')
-
- U = PyTango.Util.instance()
- U.server_init()
- U.server_run()
-
- except PyTango.DevFailed,e:
- print '-------> Received a DevFailed exception:',e
- except Exception,e:
- print '-------> An unforeseen exception occured....',e
-
- if __name__ == "__main__":
- main()
-
-
-*Pretty cool, uh?*
-"""
+"""High Level API for writting Tango device servers."""
from __future__ import with_statement
from __future__ import print_function
@@ -463,12 +276,8 @@ def DeviceMeta(name, bases, attrs):
class Device(LatestDeviceImpl):
- """High level DeviceImpl API.
-
- .. seealso::
-
- Module :py:mod:`PyTango.hlapi`
- Full High Level API documentation"""
+ """High level DeviceImpl API. All Device specific classes should inherit
+ from this class."""
def __init__(self, cl, name):
LatestDeviceImpl.__init__(self, cl, name)
@@ -501,14 +310,8 @@ class AttrData2(AttrData):
obj.remove_attribute(self.attr_name)
def attribute(**kwargs):
- if 'dtype' in kwargs:
- kwargs['dtype'] = get_tango_type(kwargs['dtype'])
- return AttrData2.from_dict(kwargs)
-
-
-attribute.__doc__ = """\
-declares a new tango attribute in a :class:`Device`. To be used like the python
-native :obj:`property` function. For exampke, to declare a scalar,
+ """declares a new tango attribute in a :class:`Device`. To be used like the python
+native :obj:`property` function. For example, to declare a scalar,
`PyTango.DevDouble`, read-only attribute called *voltage* in a *PowerSupply*
:class:`Device` do::
@@ -525,27 +328,45 @@ It receives multiple keyword arguments.
parameter type default value description
===================== ========================================== ============================================== =======================================================================================
name :obj:`str` class member name alternative attribute name
-dtype :obj:`object` :obj:`~PyTango.CmdArgType`\ ``.DevDouble`` data type (see :ref:`Data type equivalence <pytango-hlapi-datatypes:
-
-The `dtype` parameter in :func:`attribute` is not retricted to the :obj:`~PyTango.CmdArgType options.
-For example, to define a :obj:`~PyTango.CmdArgType`\ ``.DevLong`` attribute you
-have several possibilities:
-
- #. :obj:`int`
- #. 'int'
- #. 'int32'
- #. 'integer'
- #. :obj:`~PyTango.CmdArgType`\ ``.DevLong``
- #. 'DevLong'
- #. :obj:`numpy.int32`
-
-Below is the complete table of equivalences.
-
-.. rubric:: Data type equivalence
+dtype :obj:`object` :obj:`~PyTango.CmdArgType`\ ``.DevDouble`` data type (see :ref:`Data type equivalence <pytango-hlapi-datatypes>`)
+dformat :obj:`~PyTango.AttrDataFormat` :obj:`~PyTango.AttrDataFormat`\ ``.SCALAR`` data format
+max_dim_x :obj:`int` 1 maximum size for x dimension (ignored for SCALAR format)
+max_dim_y :obj:`int` 0 maximum size for y dimension (ignored for SCALAR and SPECTRUM formats)
+display_level :obj:`~PyTango.DispLevel` :obj:`~PyTango.DisLevel`\ ``.OPERATOR`` display level
+polling_period :obj:`int` -1 polling period
+memorized :obj:`bool` False attribute should or not be memorized
+hw_memorized :obj:`bool` False write method should be called at startup when restoring memorize value (dangerous!)
+access :obj:`~PyTango.AttrWriteType` :obj:`~PyTango.AttrWriteType`\ ``.READ`` read only/ read write / write only access
+fread :obj:`str` or :obj:`callable` 'read_<attr_name>' read method name or method object
+fwrite :obj:`str` or :obj:`callable` 'write_<attr_name>' write method name or method object
+is_allowed :obj:`str` or :obj:`callable` 'is_<attr_name>_allowed' is allowed method name or method object
+label :obj:`str` '<attr_name>' attribute label
+description :obj:`str` '' attribute description
+unit :obj:`str` '' physical units the attribute value is in
+standard_unit :obj:`str` '' physical standard unit
+display_unit :obj:`str` '' physical display unit (hint for clients)
+format :obj:`str` '6.2f' attribute representation format
+min_value :obj:`str` None minimum allowed value
+max_value :obj:`str` None maximum allowed value
+min_alarm :obj:`str` None minimum value to trigger attribute alarm
+max_alarm :obj:`str` None maximum value to trigger attribute alarm
+min_warning :obj:`str` None minimum value to trigger attribute warning
+max_warning :obj:`str` None maximum value to trigger attribute warning
+delta_val :obj:`str` None
+delta_t :obj:`str` None
+abs_change :obj:`str` None minimum value change between events that causes event filter to send the event
+rel_change :obj:`str` None minimum relative change between events that causes event filter to send the event (%)
+period :obj:`str` None
+archive_abs_change :obj:`str` None
+archive_rel_change :obj:`str` None
+archive_period :obj:`str` None
+===================== ========================================== ============================================== ======================================================================================="""
+ if 'dtype' in kwargs:
+ kwargs['dtype'] = get_tango_type(kwargs['dtype'])
+ return AttrData2.from_dict(kwargs)
-""" + __type_doc
-class command:
+def command():
"""TODO"""
pass
@@ -557,3 +378,27 @@ def class_property():
"""TODO"""
pass
+__doc__ = """High Level API for writting Tango device servers.
+
+.. _pytango-hlapi-datatypes:
+
+.. rubric:: Data types
+
+When declaring attributes, properties or commands, one of the most important
+information is the data type. It is given by the keyword argument *dtype*.
+This argument is not retricted to the :obj:`~PyTango.CmdArgType` options.
+
+For example, to define a :obj:`~PyTango.CmdArgType.DevLong` attribute you
+have several possibilities:
+
+ #. :obj:`int`
+ #. 'int'
+ #. 'int32'
+ #. 'integer'
+ #. :obj:`~PyTango.CmdArgType.DevLong`
+ #. 'DevLong'
+ #. :obj:`numpy.int32`
+
+Below is the complete table of equivalences.
+
+""" + __type_doc
diff --git a/src/boost/python/pytango_init.py b/src/boost/python/pytango_init.py
index 0e4c19f..3dc2573 100644
--- a/src/boost/python/pytango_init.py
+++ b/src/boost/python/pytango_init.py
@@ -46,7 +46,7 @@ __DOC = True
def init_constants():
import sys
import platform
-
+
tg_ver = tuple(map(int, constants.TgLibVers.split(".")))
tg_ver_str = "0x%02d%02d%02d00" % (tg_ver[0], tg_ver[1], tg_ver[2])
constants.TANGO_VERSION_HEX = int(tg_ver_str, 16)
@@ -60,10 +60,7 @@ def init_constants():
PY_VERSION = constants.PY_VERSION
TANGO_VERSION = constants.TANGO_VERSION
BOOST_VERSION = constants.BOOST_VERSION
- if constants.NUMPY_SUPPORT:
- NUMPY_VERSION = '0.0.0'
- else:
- NUMPY_VERSION = None
+ NUMPY_VERSION = constants.NUMPY_VERSION
#UNAME = tuple(map(str, json.loads(constants.UNAME)))
tg_rt_ver_nb = _get_tango_lib_release()
diff --git a/src/boost/python/utils.py b/src/boost/python/utils.py
index 04456fa..32a8788 100644
--- a/src/boost/python/utils.py
+++ b/src/boost/python/utils.py
@@ -1266,21 +1266,22 @@ def info():
Runtime = PyTango.constants.Runtime
msg = """\
+PyTango {0.Release.version} {0.Release.version_info}
PyTango compiled with:
- Python : {0.PY_VERSION}
- Numpy : {0.NUMPY_VERSION}
- Tango : {0.TANGO_VERSION}
- Boost : {0.BOOST_VERSION}
-
-PyTango runtime is:
Python : {1.PY_VERSION}
Numpy : {1.NUMPY_VERSION}
Tango : {1.TANGO_VERSION}
Boost : {1.BOOST_VERSION}
+PyTango runtime is:
+ Python : {2.PY_VERSION}
+ Numpy : {2.NUMPY_VERSION}
+ Tango : {2.TANGO_VERSION}
+ Boost : {2.BOOST_VERSION}
+
PyTango running on:
-{1.UNAME}
+{2.UNAME}
"""
- msg = msg.format(Compile, Runtime)
+ msg = msg.format(PyTango, Compile, Runtime)
+ return msg
- print(msg)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git
More information about the debian-science-commits
mailing list