The ispy
package is a Python interface to the Information Service (IS).
It allows easy access from a scripting language to all the information in IS.
To use the package, simply start the tdaq_python
interpreter:
% tdaq_python Python 2.5 (r25:51908, Oct 18 2007, 16:26:11) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from ispy import *
The following classes from IS are available in Python:
The following minimal script shows how to use the basic classes. The special
method _update()
in ISNamedInfo
makes all the IS
attributes available as Python attributes.
#!/usr/bin/env tdaq_python part_name = 'rhauser_test' import sys from ispy import * p = IPCPartition(part_name) if not p.isValid(): print "Partition:",p.name(),"is not valid" sys.exit(1) x = ISNamedInfo(p, 'DF.L2SV-1', 'L2SV') x._update(p, 'L2SV') print "Exists: ",x.isExist() print dir(x) print x
Several utility classes are provide to make it easier to read
arbitrary information from IS. See the examples
directory
for how to use them.
The ispygui.py
is a simple application using Tcl/Tk to
give an overview of the dataflow part of a running partition.