[pytango] 32/37: Update documentation and release number

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:16:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

sbodomerle-guest pushed a commit to annotated tag v9.2.0b
in repository pytango.

commit c9f2dd72b168958211825b75e0b235bc83fa247a
Author: Jose Tiago Coutinho Macara <tiago.coutinho at esrf.fr>
Date:   Fri Feb 26 13:01:07 2016 +0100

    Update documentation and release number
---
 doc/_static/PowerSupplyDS.py                |   9 ++-
 doc/_static/{default.css => pytango.css}    |  44 ++++++++---
 doc/_templates/index.html                   |   2 +-
 doc/_templates/indexsidebar.html            |  14 ++--
 doc/_templates/layout.html                  |   2 +-
 doc/client_api/other.rst                    |   2 +
 doc/conf.py                                 |   7 +-
 doc/data_types.rst                          | 117 ++++++++++++++++++++++++++++
 doc/faq.rst                                 |   5 +-
 doc/howto.rst                               |  19 ++++-
 doc/quicktour.rst                           |  16 +++-
 doc/revision.rst                            |  17 +++-
 doc/server_api/server.rst                   |   6 ++
 doc/sphinxext/tango_console_highlighting.py |  32 +++-----
 src/boost/python/base_types.py              |   8 ++
 src/boost/python/device_proxy.py            |  46 ++++++++++-
 src/boost/python/device_server.py           |   2 +-
 src/boost/python/release.py                 |   4 +-
 src/boost/python/server.py                  |  33 +++++---
 19 files changed, 310 insertions(+), 75 deletions(-)

diff --git a/doc/_static/PowerSupplyDS.py b/doc/_static/PowerSupplyDS.py
index e5b8e0d..47946c7 100644
--- a/doc/_static/PowerSupplyDS.py
+++ b/doc/_static/PowerSupplyDS.py
@@ -7,7 +7,7 @@ import time
 import numpy
 
 from PyTango import AttrQuality, AttrWriteType, DispLevel, DevState, DebugIt
-from PyTango.server import Device, DeviceMeta, attribute, command, run
+from PyTango.server import Device, DeviceMeta, attribute, command, pipe, run
 from PyTango.server import device_property
 
 
@@ -35,6 +35,8 @@ class PowerSupply(Device):
                       dtype=((int,),),
                       max_dim_x=1024, max_dim_y=1024)
 
+    info = pipe(label='Info')
+
     host = device_property(dtype=str)
     port = device_property(dtype=int, default_value=9788)
     
@@ -54,6 +56,11 @@ class PowerSupply(Device):
         # should set the power supply current
         self.__current = current
 
+    def read_info(self):
+        return 'Information', dict(manufacturer='Tango',
+                                   model='PS2000',
+                                   version_number=123)
+
     @DebugIt()
     def read_noise(self):
         return numpy.random.random_integers(1000, size=(100, 100))
diff --git a/doc/_static/default.css b/doc/_static/pytango.css
similarity index 87%
rename from doc/_static/default.css
rename to doc/_static/pytango.css
index db3b120..071071d 100644
--- a/doc/_static/default.css
+++ b/doc/_static/pytango.css
@@ -1,8 +1,13 @@
-/**
- * Sphinx stylesheet -- sphinxdoc theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/*
+ * sphinxdoc.css_t
+ * ~~~~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- sphinxdoc theme.  Originally created by
+ * Armin Ronacher for Werkzeug.
+ *
+ * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
  *
- * Originally created by Armin Ronacher for Werkzeug, adapted by Georg Brandl.
  */
 
 @import url("basic.css");
@@ -21,7 +26,7 @@ body {
     padding: 0;
     border: 1px solid #aaa;
 
-    margin: 0px 40px 0px 40px;
+    margin: 0px 20px 0px 20px;
     min-width: 740px;
 }
 
@@ -43,7 +48,7 @@ div.body {
 }
 
 div.related {
-    font-size: 12px;
+    font-size: 1em;
 }
 
 div.related ul {
@@ -199,20 +204,20 @@ a.headerlink:hover {
     color: white!important;
 }
 
-cite, code, tt {
+cite, code, code {
     font-family: 'Consolas', 'Deja Vu Sans Mono',
                  'Bitstream Vera Sans Mono', monospace;
     font-size: 0.95em;
     letter-spacing: 0.01em;
 }
 
-tt {
+code {
     background-color: #f2f2f2;
     border-bottom: 1px solid #ddd;
     color: #333;
 }
 
-tt.descname, tt.descclassname, tt.xref {
+code.descname, code.descclassname, code.xref {
     border: 0;
 }
 
@@ -221,12 +226,12 @@ hr {
     margin: 2em;
 }
 
-a tt {
+a code {
     border: 0;
     color: #CA7900;
 }
 
-a tt:hover {
+a code:hover {
     color: #2491CF;
 }
 
@@ -320,4 +325,21 @@ div.versioninfo {
     padding: 8px;
     line-height: 1.3em;
     font-size: 0.9em;
+}
+
+.viewcode-back {
+    font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
+                 'Verdana', sans-serif;
+}
+
+div.viewcode-block:target {
+    background-color: #f4debf;
+    border-top: 1px solid #ac9;
+    border-bottom: 1px solid #ac9;
+}
+
+div.code-block-caption {
+    background-color: #ddd;
+    color: #222;
+    border: 1px solid #ccc;
 }
\ No newline at end of file
diff --git a/doc/_templates/index.html b/doc/_templates/index.html
index 4b81976..aa4426f 100644
--- a/doc/_templates/index.html
+++ b/doc/_templates/index.html
@@ -53,7 +53,7 @@
 
 <p>
   PyTango is a python module that exposes to <a class="reference external" href="http://www.python.org/">Python</a>
-  the complete <a class="reference external" href="http://www.tango-controls.org/">Tango</a> C++ API.
+  the complete <a class="reference external" href="http://www.esrf.eu/computing/cs/tango/tango_doc/kernel_doc/cpp_doc/index.html">Tango C++ API</a>.
   This means that you can write not only tango applications (scripts, CLIs, GUIs)
   that access tango device servers but also tango device servers themselves, all
   of this in pure python.
diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html
index 7f4ef73..25d2e8a 100644
--- a/doc/_templates/indexsidebar.html
+++ b/doc/_templates/indexsidebar.html
@@ -1,22 +1,18 @@
 <h3>Download</h3>
-<p>Current version: <b>{{ version }}</b></p>
+<p>Current version: <b>{{ release }}</b></p>
 <p>Get PyTango from <a href="http://pypi.python.org/pypi/PyTango">PyPi</a><br/>
 or install it with:</p>
 <pre>pip install PyTango</pre>
-or
-<pre>easy_install -U PyTango</pre>
 
 <h3>PDF</h3>
 <p>A PDF version <a href="PyTango.pdf">here</a>.
 
 
 <h3>Other versions</h3>
-<a href="http://www.tango-controls.org/static/PyTango/development/doc/html">Development</a>
+<a href="http://www.esrf.eu/computing/cs/tango/pytango/development/index.html">Development</a>
 <br/>
-<a href="http://www.tango-controls.org/static/PyTango/latest/doc/html">Latest stable</a>
+<a href="http://www.esrf.eu/computing/cs/tango/pytango/latest/index.html">Latest stable</a>
 <br/>
-<a href="http://www.tango-controls.org/static/PyTango/v812/doc/html">8.1.2</a>
+<a href="http://www.esrf.eu/computing/cs/tango/pytango/v818/index.html">8.1.8</a>
 <br/>
-<a href="http://www.tango-controls.org/static/PyTango/v811/doc/html">8.1.1</a>
-<br/>
-<a href="http://www.tango-controls.org/static/PyTango/v723/doc/html">7.2.3</a>
+<a href="http://www.esrf.eu/computing/cs/tango/pytango/v816/index.html">8.1.6</a>
diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html
index dece097..6592bd9 100644
--- a/doc/_templates/layout.html
+++ b/doc/_templates/layout.html
@@ -9,5 +9,5 @@
     <li><a href="{{ pathto('quicktour') }}">quick tour</a>| </li>
     <li><a href="{{ pathto('howto') }}">how to</a>| </li>
     <li><a href="{{ pathto('faq') }}">FAQ</a>| </li>
-    <li><a href="{{ pathto('contents') }}">documentation </a> »</li>
+    <li><a href="{{ pathto('contents') }}">documentation (v{{ release }})</a> »</li>
 {% endblock %}
diff --git a/doc/client_api/other.rst b/doc/client_api/other.rst
index d8b7fe8..f50b8b4 100644
--- a/doc/client_api/other.rst
+++ b/doc/client_api/other.rst
@@ -42,6 +42,8 @@ Enumerations
 
 .. autoclass:: PyTango.AttrDataFormat
 
+.. autoclass:: PyTango.PipeWriteType
+
 .. autoclass:: PyTango.DevSource
 
 .. autoclass:: PyTango.ErrSeverity
diff --git a/doc/conf.py b/doc/conf.py
index 33b44da..0080b18 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -14,6 +14,9 @@ import os
 import re
 import PyTango
 
+print("Building documentation for PyTango {0}".format(PyTango.__version_long__))
+print("Using PyTango from: {0}".format(os.path.dirname(PyTango.__file__)))
+
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -73,7 +76,7 @@ is licensed under a
 # The short X.Y version.
 version = '.'.join(PyTango.Release.version.split('.')[:2])
 # The full version, including alpha/beta/rc tags.
-release = PyTango.Release.version
+release = PyTango.Release.version_long
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -128,6 +131,8 @@ html_theme = 'sphinxdoc'
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = []
 
+html_style = 'pytango.css'
+
 # The name for this set of Sphinx documents.  If None, it defaults to
 # "<project> v<release> documentation".
 #html_title = "PyTango documentation"
diff --git a/doc/data_types.rst b/doc/data_types.rst
index 423c3f1..eb08d47 100644
--- a/doc/data_types.rst
+++ b/doc/data_types.rst
@@ -198,3 +198,120 @@ where the tango data is used, and the availability of :py:mod:`numpy`.
     - :py:class:`numpy.ndarray` if PyTango was compiled with :py:mod:`numpy`
       support (default) and :py:mod:`numpy` is installed.
     - :py:class:`list` otherwise
+
+
+.. _pytango-pipe-data-types:
+
+Pipe data types
+---------------
+
+Pipes require different data types. You can think of them as a structured type.
+
+A pipe transports data which is called a *blob*. A *blob* consists of name and
+a list of fields. Each field is called *data element*. Each *data element*
+consists of a name and a value. *Data element* names must be unique in the same
+blob.
+
+The value can be of any of the SCALAR or SPECTRUM tango data types (except
+DevEnum).
+
+Additionally, the value can be a *blob* itself.
+
+In PyTango, a *blob* is represented by a sequence of two elements:
+
+* blob name (str)
+* data is either:
+
+  * sequence (:py:class:`list`, :py:class:`tuple`, or other) of data elements
+    where each element is a :py:class:`dict` with the following keys:
+
+    * *name* (mandatory): (str) data element name
+    * *value* (mandatory): data (compatible with any of the SCALAR or SPECTRUM
+      data types except DevEnum). If value is to be a sub-*blob* then it
+      should be sequence of [*blob name*, sequence of data elements]
+      (see above)
+    * *dtype* (optional, mandatory if a DevEncoded is required):
+      see :ref:`Data type equivalence <pytango-hlapi-datatypes>`. If dtype
+      key is not given, PyTango will try to find the proper tango type by
+      inspecting the value.
+
+  * a :py:class:`dict` where key is the data element name and value is the data
+    element value (compact version)
+
+When using the compact dictionary version note that the order of the data elements
+is lost. If the order is important for you, consider using
+:py:class:`collections.OrderedDict` instead (if you have python >=2.7. If not you can
+use ``ordereddict`` backport module available on pypi).
+Also, in compact mode it is not possible to enforce a specific type. As a
+consequence, DevEncoded is not supported in compact mode.
+
+The description sounds more complicated that it actually is. Here are some practical
+examples of what you can return in a server as a read request from a pipe::
+
+    import numpy as np
+
+    # plain (one level) blob showing different tango data types
+    # (explicity and implicit):
+
+    PIPE0 = \
+    ('BlobCase0',
+     ({'name': 'DE1', 'value': 123,},                                # converts to DevLong64
+      {'name': 'DE2', 'value': np.int32(456),},                      # converts to DevLong
+      {'name': 'DE3', 'value': 789, 'dtype': 'int32'},               # converts to DevLong
+      {'name': 'DE4', 'value': np.uint32(123)},                      # converts to DevULong
+      {'name': 'DE5', 'value': range(5), 'dtype': ('uint16',)},      # converts to DevVarUShortArray
+      {'name': 'DE6', 'value': [1.11, 2.22], 'dtype': ('float64',)}, # converts to DevVarDoubleArray
+      {'name': 'DE7', 'value': numpy.zeros((100,))},                 # converts to DevVarDoubleArray
+      {'name': 'DE8', 'value': True},                                # converts to DevBoolean
+     )
+    )
+
+
+    # similar as above but in compact version (implicit data type conversion):
+
+    PIPE1 = \
+    ('BlobCase1', dict(DE1=123, DE2=np.int32(456), DE3=np.int32(789),
+                       DE4=np.uint32(123), DE5=np.arange(5, dtype='uint16'),
+		       DE6=[1.11, 2.22], DE7=numpy.zeros((100,)),
+		       DE8=True)
+    )
+
+    # similar as above but order matters so we use an ordered dict:
+
+    import collections
+
+    data = collections.OrderedDict()
+    data['DE1'] = 123
+    data['DE2'] = np.int32(456)
+    data['DE3'] = np.int32(789)
+    data['DE4'] = np.uint32(123)
+    data['DE5'] = np.arange(5, dtype='uint16')
+    data['DE6'] = [1.11, 2.22]
+    data['DE7'] = numpy.zeros((100,))
+    data['DE8'] = True
+
+    PIPE2 = 'BlobCase2', data
+
+    # another plain blob showing string, string array and encoded data types:
+
+    PIPE3 = \
+    ('BlobCase3',
+     ({'name': 'stringDE',  'value': 'Hello'},
+      {'name': 'VectorStringDE', 'value': ('bonjour', 'le', 'monde')},
+      {'name': 'DevEncodedDE', 'value': ('json', '"isn\'t it?"'), 'dtype': 'bytes'},
+     )
+    )
+
+    # blob with sub-blob which in turn has a sub-blob
+
+    PIPE4 = \
+    ('BlobCase4',
+     ({'name': '1DE', 'value': ('Inner', ({'name': '1_1DE', 'value': 'Grenoble'},
+                                          {'name': '1_2DE', 'value': ('InnerInner',
+                                                                      ({'name': '1_1_1DE', 'value': np.int32(111)},
+                                                                       {'name': '1_1_2DE', 'value': [3.33]}))
+                                         })
+      )},
+      {'name': '2DE', 'value': (3,4,5,6), 'dtype': ('int32',) },
+     )
+    )
diff --git a/doc/faq.rst b/doc/faq.rst
index c559ec7..9d6bb86 100644
--- a/doc/faq.rst
+++ b/doc/faq.rst
@@ -5,9 +5,10 @@
 FAQ
 ===
 
-Answers to general Tango questions can be found at http://www.tango-controls.org/tutorials
+Answers to general Tango questions can be found in the
+`general tango tutorial <http://www.tango-controls.org/resources/tutorials>`_.
 
-Please also check http://www.tango-controls.org/howtos for a list of Tango howtos
+Please also check the `general tango how to <http://www.tango-controls.org/resources/howto>`_.
 
 **Where are the usual bjam files?**
 
diff --git a/doc/howto.rst b/doc/howto.rst
index dbda286..b3b582d 100644
--- a/doc/howto.rst
+++ b/doc/howto.rst
@@ -10,7 +10,7 @@ How to
 ======
 
 This is a small list of how-tos specific to PyTango. A more general Tango how-to
-list can be found `here <http://www.tango-controls.org/howtos>`_.
+list can be found `here <http://www.tango-controls.org/resources/howto>`_.
 
 
 Check the default TANGO host
@@ -292,7 +292,7 @@ Write a server
 Before reading this chapter you should be aware of the TANGO basic concepts.
 This chapter does not explain what a Tango device or a device server is.
 This is explained in details in the
-`Tango control system manual <http://www.tango-controls.org/TangoKernel>`_
+`Tango control system manual <http://www.tango-controls.org/resources/documentation/kernel/>`_
 
 Since version 8.1, PyTango provides a helper module which simplifies the 
 development of a Tango device server. This helper is provided through the
@@ -307,7 +307,7 @@ high level API
     import time
     from PyTango.server import run
     from PyTango.server import Device, DeviceMeta
-    from PyTango.server import attribute, command   
+    from PyTango.server import attribute, command, pipe
 
 
     class Clock(Device):
@@ -321,6 +321,13 @@ high level API
         def strftime(self, format):
             return time.strftime(format)
 
+	@pipe
+	def info(self):
+            return ('Information',
+                    dict(manufacturer='Tango',
+	                 model='PS2000',
+                         version_number=123))
+
 
     if __name__ == "__main__":
         run([Clock])
@@ -349,7 +356,11 @@ high level API
     Tango command, it must be decorated as such with the
     :func:`~PyTango.server.command` decorator
 
-**line 20**
+**line 18-23**
+    definition of the *info* pipe. Check the :class:`~PyTango.server.pipe`
+    for the complete list of pipe options.
+
+**line 28**
     start the Tango run loop. The mandatory argument is a list of python classes
     that are to be exported as Tango classes. Check :func:`~PyTango.server.run`
     for the complete list of options
diff --git a/doc/quicktour.rst b/doc/quicktour.rst
index cd346a2..d4380f1 100644
--- a/doc/quicktour.rst
+++ b/doc/quicktour.rst
@@ -10,16 +10,20 @@ Fundamental TANGO concepts
 
 Before you begin there are some fundamental TANGO concepts you should be aware of.
 
-Tango consists basically of a set of **devices** running somewhere on the network.
+Tango consists basically of a set of *devices* running somewhere on the network.
 
 A device is identified by a unique case insensitive name in the format 
 *<domain>/<family>/<member>*. Examples: `LAB-01/PowerSupply/01`, 
 `ID21/OpticsHutch/energy`. 
 
-Each device has a series of *attributes*, *properties* and *commands*. 
+Each device has a series of *attributes*, *pipes*, *properties* and *commands*.
 
 An attribute is identified by a name in a device. It has a value that can 
-be read. Some attributes can also be changed (read-write attributes).
+be read. Some attributes can also be changed (read-write attributes). Each
+attribute has a well known, fixed data type.
+
+A pipe is a kind of attribute. Unlike attributes, the pipe data type is strucured
+(in the sence of C struct) and it is dynamic.
 
 A property is identified by a name in a device. Usually, devices properties are
 used to provide a way to configure a device. 
@@ -58,7 +62,7 @@ for you. You need to ask your facility/institute tango contact for the
 :envvar:`TANGO_HOST` variable where Tango system is running. 
 
 If you are working in an isolate machine you first need to make sure the Tango
-system is installed and running (`Tango howtos <http://www.tango-controls.org/howtos>`_).
+system is installed and running (see `tango how to <http://www.tango-controls.org/resources/howto>`_).
 
 Most examples here connect to a device called *sys/tg_test/1* that runs in a 
 TANGO server called *TangoTest* with the instance name *test*.
@@ -185,6 +189,10 @@ which will have attributes:
 * *current* (scalar, read_write, numeric, expert mode) 
 * *noise* (2D, read-only, numeric)
 
+pipes:
+
+* *info* (read-only)
+
 commands:
 
 * *TurnOn* (argument: None, result: None)
diff --git a/doc/revision.rst b/doc/revision.rst
index 17765b3..ce35c1f 100644
--- a/doc/revision.rst
+++ b/doc/revision.rst
@@ -83,9 +83,11 @@ Document revisions
 +----------+----------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------+
 | 01/10/14 | `8.21 <http://www.tango-controls.org/static/PyTango/v815/doc/html/index.html>`_  | Update to PyTango 8.1.5                             | T\. Coutinho          |
 +----------+----------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------+
-| 05/02/15 | `8.22 <http://www.tango-controls.org/static/PyTango/v816/doc/html/index.html>`_  | Update to PyTango 8.1.6                             | T\. Coutinho          |
+| 05/02/15 | `8.22 <http://www.esrf.fr/computing/cs/tango/pytango/v816/index.html>`_          | Update to PyTango 8.1.6                             | T\. Coutinho          |
 +----------+----------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------+
-| 02/02/15 | `8.23 <http://www.tango-controls.org/static/PyTango/v817/doc/html/index.html>`_  | Update to PyTango 8.1.8                             | T\. Coutinho          |
+| 03/02/16 | `8.23 <http://www.esrf.fr/computing/cs/tango/pytango/v818/index.html>`_          | Update to PyTango 8.1.8                             | T\. Coutinho          |
++----------+----------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------+
+| 26/02/16 | `9.2  <http://www.esrf.fr/computing/cs/tango/pytango/v920/index.html>`_          | Update to PyTango 9.2.0a                            | T\. Coutinho          |
 +----------+----------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------+
 
 .. _pytango-version-history:
@@ -96,6 +98,17 @@ Version history
 +----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | version  | Changes                                                                                                                                                               |
 +==========+=======================================================================================================================================================================+
+| 9.2.0a   | 9.2 alpha release. Missing:                                                                                                                                           |
+|          |                                                                                                                                                                       |
+|          |     - writtable pipes (client and server)                                                                                                                             |
+|          |     - dynamic commands (server)                                                                                                                                       |
+|          |     - device interface change event (client and server)                                                                                                               |
+|          |     - pipe event (client and server)                                                                                                                                  |
+|          |                                                                                                                                                                       |
+|          | Bug fixes:                                                                                                                                                            |
+|          |                                                                                                                                                                       |
+|          |     - `776:  [pytango][8.1.8] SyntaxError: invalid syntax <https://sourceforge.net/p/tango-cs/bugs/776/>`_                                                            |
++----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | 8.1.8    | Features:                                                                                                                                                             |
 |          |                                                                                                                                                                       |
 |          |     - `110:  device property with auto update in database <https://sourceforge.net/p/tango-cs/feature-requests/110>`_                                                 |
diff --git a/doc/server_api/server.rst b/doc/server_api/server.rst
index 9a3a65b..40a0f6b 100644
--- a/doc/server_api/server.rst
+++ b/doc/server_api/server.rst
@@ -13,6 +13,7 @@ High level server API
    * :class:`~PyTango.server.Device`
    * :class:`~PyTango.server.attribute`
    * :class:`~PyTango.server.command`
+   * :class:`~PyTango.server.pipe`
    * :class:`~PyTango.server.device_property`
    * :class:`~PyTango.server.class_property`
    * :func:`~PyTango.server.run`
@@ -283,6 +284,9 @@ dtype argument                            converts to tango type
  
  ``DevVarDoubleStringArray``               ``DevVarDoubleStringArray``
  ``'DevVarDoubleStringArray'``             ``DevVarDoubleStringArray``
+
+ ``DevPipeBlob``                           ``DevPipeBlob``
+ ``'DevPipeBlob'``                         ``DevPipeBlob``
 ========================================  ========================================
 
 .. autoclass:: Device
@@ -294,6 +298,8 @@ dtype argument                            converts to tango type
 
 .. autofunction:: command
 
+.. autoclass:: pipe
+
 .. autoclass:: device_property
 
 .. autoclass:: class_property
diff --git a/doc/sphinxext/tango_console_highlighting.py b/doc/sphinxext/tango_console_highlighting.py
index fa70aff..1e6bdff 100644
--- a/doc/sphinxext/tango_console_highlighting.py
+++ b/doc/sphinxext/tango_console_highlighting.py
@@ -1,25 +1,13 @@
-################################################################################
-##
-## This file is part of PyTango, a python binding for Tango
-## 
-## http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
-##
-## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
-## 
-## PyTango is free software: you can redistribute it and/or modify
-## it under the terms of the GNU Lesser General Public License as published by
-## the Free Software Foundation, either version 3 of the License, or
-## (at your option) any later version.
-## 
-## PyTango is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-## GNU Lesser General Public License for more details.
-## 
-## You should have received a copy of the GNU Lesser General Public License
-## along with PyTango.  If not, see <http://www.gnu.org/licenses/>.
-##
-################################################################################
+# ------------------------------------------------------------------------------
+# This file is part of PyTango (http://www.tinyurl.com/PyTango)
+#
+# Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain
+# Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France
+#
+# Distributed under the terms of the GNU Lesser General Public License,
+# either version 3 of the License, or (at your option) any later version.
+# See LICENSE.txt for more info.
+# ------------------------------------------------------------------------------
 
 """reST directive for syntax-highlighting itango interactive sessions.
 """
diff --git a/src/boost/python/base_types.py b/src/boost/python/base_types.py
index c35c06f..e6617fa 100644
--- a/src/boost/python/base_types.py
+++ b/src/boost/python/base_types.py
@@ -358,6 +358,7 @@ def __doc_base_types():
         - DevInt
         - DevEncoded
         - DevEnum
+        - DevPipeBlob
     """ )
 
     document_enum("LockerLanguage", """
@@ -541,7 +542,14 @@ def __doc_base_types():
         - IMAGE
         - FMT_UNKNOWN
     """ )
+
+    document_enum("PipeWriteType", """
+    An enumeration representing the pipe type
     
+        - PIPE_READ
+        - PIPE_READ_WRITE
+    """ )
+
     document_enum("DevSource", """
     An enumeration representing the device source for data
     
diff --git a/src/boost/python/device_proxy.py b/src/boost/python/device_proxy.py
index df768b9..500b6ea 100644
--- a/src/boost/python/device_proxy.py
+++ b/src/boost/python/device_proxy.py
@@ -815,7 +815,7 @@ def __DeviceProxy__get_pipe_config(self, value=None):
         Throws     : ConnectionFailed, CommunicationFailed,
                      DevFailed from device
 
-        New in PyTango 9.0.0
+        New in PyTango 9.2.0
     """
     if value is None:
         value = [constants.AllPipe]
@@ -1819,10 +1819,52 @@ def __doc_DeviceProxy():
                      TimeoutError (green_mode == Futures) If the future didn't finish executing before the given timeout.
                      Timeout (green_mode == Gevent) If the async result didn't finish executing before the given timeout.
 
-        New in PyTango 9.0.0
+        New in PyTango 9.2.0
     """)
 
 #-------------------------------------
+#   Pipe methods
+#-------------------------------------
+
+    document_method("read_pipe", """
+    read_pipe(self, pipe_name, extract_as=ExtractAs.Numpy, green_mode=None, wait=True, timeout=None) -> tuple
+
+            Read a single pipe. The result is a *blob*: a tuple with two elements: blob name (string) and blob
+            data (sequence). The blob data consists of a sequence where each element is a dictionary with the
+            following keys:
+
+            - name: blob element name
+            - dtype: tango data type
+            - value: blob element data (str for DevString, etc)
+
+        In case dtype is ``DevPipeBlob``, value is again a *blob*.
+
+        Parameters :
+            - pipe_name  : (str) The name of the pipe to read.
+            - extract_as : (ExtractAs) Defaults to numpy.
+            - green_mode : (GreenMode) Defaults to the current DeviceProxy GreenMode.
+                           (see :meth:`~PyTango.DeviceProxy.get_green_mode` and
+                           :meth:`~PyTango.DeviceProxy.set_green_mode`).
+            - wait       : (bool) whether or not to wait for result. If green_mode
+                           is *Synchronous*, this parameter is ignored as it always
+                           waits for the result.
+                           Ignored when green_mode is Synchronous (always waits).
+            - timeout    : (float) The number of seconds to wait for the result.
+                           If None, then there is no limit on the wait time.
+                           Ignored when green_mode is Synchronous or wait is False.
+
+        Return     : tuple<str, sequence>
+
+        Throws     : ConnectionFailed, CommunicationFailed, DevFailed from device
+                     TimeoutError (green_mode == Futures) If the future didn't finish executing before the given timeout.
+                     Timeout (green_mode == Gevent) If the async result didn't finish executing before the given timeout.
+
+        New in PyTango 9.2.0
+    """)
+
+    document_method("write_pipe", """TODO""")
+
+#-------------------------------------
 #   History methods
 #-------------------------------------
     document_method("command_history", """
diff --git a/src/boost/python/device_server.py b/src/boost/python/device_server.py
index aa40a94..b31d844 100644
--- a/src/boost/python/device_server.py
+++ b/src/boost/python/device_server.py
@@ -626,7 +626,7 @@ def __UserDefaultAttrProp_set_enum_labels(self, enum_labels):
         Parameters :
             - enum_labels : (seq<str>) list of enumeration labels
 
-        New in PyTango 9.1.0
+        New in PyTango 9.2.0
     """
     elbls = StdStringVector()
     for enu in enum_labels:
diff --git a/src/boost/python/release.py b/src/boost/python/release.py
index 52cdd84..df137c7 100644
--- a/src/boost/python/release.py
+++ b/src/boost/python/release.py
@@ -40,7 +40,7 @@ class Release:
             - keywords : (seq<str>) list of keywords
             - license : (str) the license"""
     name = 'PyTango'
-    version_info = (9, 2, 0, 'dev', 0)
+    version_info = (9, 2, 0, 'a', 1)
     version = '.'.join(map(str, version_info[:3]))
     version_long = version + ''.join(map(str, version_info[3:]))
     version_description = 'This version implements the C++ Tango 9.2 API.'
@@ -51,7 +51,7 @@ class Release:
     license = 'LGPL'
     authors = { 'Coutinho' : ('Tiago Coutinho' , 'coutinho at esrf.fr') }
     author_lines = "\n".join([ "%s <%s>" % x for x in authors.values()])
-    url = 'http://www.tinyurl.com/PyTango/'
+    url = 'http://www.esrf.fr/computing/cs/tango/pytango/'
     download_url = 'http://pypi.python.org/pypi/PyTango'
     platform = ['Linux', 'Windows XP/Vista/7/8']
     keywords = ['Tango', 'CORBA', 'binding']
diff --git a/src/boost/python/server.py b/src/boost/python/server.py
index 5b39ff5..7980b7e 100644
--- a/src/boost/python/server.py
+++ b/src/boost/python/server.py
@@ -876,9 +876,14 @@ class attribute(AttrData):
 class pipe(PipeData):
     '''
     Declares a new tango pipe in a :class:`Device`. To be used
-    like the python native :obj:`property` function. For example, to
-    declare a read-only pipe called *ROI* (for Region Of Interest), in a 
-    *Detector* :class:`Device` do::
+    like the python native :obj:`property` function.
+
+    Checkout the :ref:`pipe data types <pytango-pipe-data-types>`
+    to see what you should return on a pipe read request and what
+    to expect as argument on a pipe write request.
+
+    For example, to declare a read-only pipe called *ROI*
+    (for Region Of Interest), in a *Detector* :class:`Device` do::
 
         class Detector(Device):
             __metaclass__ = DeviceMeta
@@ -886,16 +891,20 @@ class pipe(PipeData):
             ROI = pipe()
 
             def read_ROI(self):
-                return dict(x=0, y=10, width=100, height=200)
+                return ('ROI', ({'name': 'x', 'value': 0},
+                                {'name': 'y', 'value': 10},
+                                {'name': 'width', 'value': 100},
+                                {'name': 'height', 'value': 200}))
 
-    The same can be achieved with::
+    The same can be achieved with (also showing that a dict can be used
+    to pass blob data)::
 
         class Detector(Device):
             __metaclass__ = DeviceMeta
 
             @pipe
             def ROI(self):
-                return dict(x=0, y=10, width=100, height=200)
+                return 'ROI', dict(x=0, y=10, width=100, height=200)
 
 
     It receives multiple keyword arguments.
@@ -916,7 +925,7 @@ class pipe(PipeData):
     write_green_mode       :obj:`~PyTango.GreenMode`        None                                    green mode for write. None means use server green mode.
     ===================== ================================ ======================================= =======================================================================================
 
-    The same example with a read-write ROI, a customized label and description and::
+    The same example with a read-write ROI, a customized label and description::
 
         class Detector(Device):
             __metaclass__ = DeviceMeta
@@ -926,13 +935,13 @@ class pipe(PipeData):
 
             def init_device(self):
                 Device.init_device(self)
-                self.__roi = dict(x=0, y=10, width=100, height=200)
+                self.__roi = 'ROI', dict(x=0, y=10, width=100, height=200)
 
             def read_ROI(self):
                 return self.__roi
 
             def write_ROI(self, roi):
-                self.__roi = dict(roi)
+                self.__roi = roi
 
 
     The same, but using pipe as a decorator::
@@ -942,7 +951,7 @@ class pipe(PipeData):
 
             def init_device(self):
                 Device.init_device(self)
-                self.__roi = dict(x=0, y=10, width=100, height=200)
+                self.__roi = 'ROI', dict(x=0, y=10, width=100, height=200)
 
             @pipe(label="Region Of Interest")
             def ROI(self):
@@ -951,12 +960,12 @@ class pipe(PipeData):
 
             @ROI.write
             def ROI(self, roi):
-                self.__roi = dict(roi)
+                self.__roi = roi
 
     In this second format, defining the `write` / `setter` implicitly sets 
     the pipe access to READ_WRITE.
 
-    .. versionadded:: 9.1.0
+    .. versionadded:: 9.2.0
     '''
 
     def __init__(self, fget=None, **kwargs):

-- 
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