libgs_ops.scheduling.Action

class libgs_ops.scheduling.Action(args, kwargs={}, desc='unnamed', retries=0)[source]

Actions are just a list and/or dict of parameters that will be passed unmodified to the protocol.

It can be useful if issuing non-standard commands (ie not bytearrays) to the protocol class for whatever reason.

Parameters:
  • args (list or tuple) – A list of arguments to pass to the protocol’s do_action() method as positional arguments
  • kwargs (dict) – A dictionary to pass to the protocol’s do_action() method as kwargs.
  • desc (str(optional)) – The description of the action
  • retries (int(optional)) – The number of times to retry the action in case of failure.

Note

It is discouraged to use any positional arguments in the do_action function besides one, which is the action selector. Then use kwargs for anything else. See libgs.protocols.protocolbase.ProtocolBase for additional information on this topic.

Methods

to_dict() Convert the action to python dictionary format

Inherited from base class

clear(() -> None.  Remove all items from D.)
copy(() -> a shallow copy of D)
fromkeys(…) v defaults to None.
get((k[,d]) -> D[k] if k in D, …)
has_key((k) -> True if D has a key k, else False)
items(() -> list of D’s (key, value) pairs, …)
iteritems(() -> an iterator over the (key, …)
iterkeys(() -> an iterator over the keys of D)
itervalues(…)
keys(() -> list of D’s keys)
pop((k[,d]) -> v, …) If key is not found, d is returned if given, otherwise KeyError is raised
popitem(() -> (k, v), …) 2-tuple; but raise KeyError if D is empty.
setdefault((k[,d]) -> D.get(k,d), …)
update(([E, …) If E present and has a .keys() method, does: for k in E: D[k] = E[k]
values(() -> list of D’s values)
viewitems(…)
viewkeys(…)
viewvalues(…)