ptypy.io.interaction.Client#
- class ptypy.io.interaction.Client(pars=None, **kwargs)#
Bases:
objectBasic but complete client to interact with the server.
- __init__(pars=None, **kwargs)#
Methods
__init__([pars])activate()Create the thread.
avail()Queries the server for the name of objects available.
do(execstr[, timeout, tag])Modify and object using an exec string.
flush()Delete all stored data (and accompanying status).
get(evalstr[, timeout, tag])Requests an object (or part of it) using an eval string.
get_now(evalstr)Synchronous get.
newdata(ticket)Meant to be replaced, e.g. to send signals to a GUI.
poll([ticket, tag])Returns true if the transaction for a given ticket is completed.
set(varname, varvalue[, timeout, tag])Sets an object named varname to the value varvalue.
stop()Send a SHUTDOWN command - is this a good idea?
unexpected_ticket(ticket)Used to deal with warnings sent by the server.
wait([ticket, tag, timeout])Blocks and return True only when the transaction for a given ticket is completed.
Attributes
DEFAULT- activate()#
Create the thread.
- avail()#
Queries the server for the name of objects available. ! Synchronous call !
- do(execstr, timeout=0, tag=None)#
Modify and object using an exec string. This function returns the “ticket number” which identifies the object once it will have been transmitted. If timeout > 0 and the requested object has been transmitted within timeout seconds, return a tuple (ticket, data).
- flush()#
Delete all stored data (and accompanying status).
- get(evalstr, timeout=0, tag=None)#
Requests an object (or part of it) using an eval string. This function returns the “ticket number” which identifies the object once it will have been transmitted. If timeout > 0 and the requested object has been transmitted within timeout seconds, return a tuple (ticket, data).
- get_now(evalstr)#
Synchronous get. May be dangerous, but should be safe for small objects like parameters.
- newdata(ticket)#
Meant to be replaced, e.g. to send signals to a GUI.
- poll(ticket=None, tag=None)#
Returns true if the transaction for a given ticket is completed. If ticket and tag are None, returns true only if no transaction is pending
- set(varname, varvalue, timeout=0, tag=None)#
Sets an object named varname to the value varvalue.
- stop_server()#
Send a SHUTDOWN command - is this a good idea?
- unexpected_ticket(ticket)#
Used to deal with warnings sent by the server.
- wait(ticket=None, tag=None, timeout=None)#
Blocks and return True only when the transaction for a given ticket is completed. If ticket is None, returns only when no more transaction are pending. If timeout is a positive number, wait will return False after timeout seconds if the ticket(s) had not been processed yet.