|
def | __del__ (self) |
|
def | __init__ (self, servers=None, paths=None, orb=None, filter=[], dynamic=False, args, kwargs) |
|
def | __str__ (self) |
|
def | add_name_server (self, server, filter=[], dynamic=None) |
|
def | get_node (self, path) |
|
def | give_away_orb (self) |
|
def | has_path (self, path) |
|
def | is_component (self, path) |
|
def | is_directory (self, path) |
|
def | is_manager (self, path) |
|
def | is_nameserver (self, path) |
|
def | is_unknown (self, path) |
|
def | is_zombie (self, path) |
|
def | iterate (self, func, args=None, filter=[]) |
|
def | load_servers_from_env (self, filter=[], dynamic=None) |
|
def | orb (self) |
|
def | own_orb (self) |
|
Tree object.
Represents a tree of name servers, directories, managers and components.
This stores the root node. All other nodes branch off from that.
When creating a tree, you may pass no arguments, or a list of name servers
to load, or a path or list of paths (as returned by
rtctree.path.parse_path). If no arguments are given, the tree will load
name servers from the environment variable specified in
NAMESERVERS_ENV_VAR. If a list of servers are given, only those servers
will be loaded.
If paths are given, and the path is just '/', behaviour is as if no path
argument were given. If a path starts with '/' and contains an element
after it, that element will be treated as a name server. Otherwise the path
is considered to be bad.
Definition at line 40 of file tree.py.
def rtctree.tree.RTCTree.__init__ |
( |
|
self, |
|
|
|
servers = None , |
|
|
|
paths = None , |
|
|
|
orb = None , |
|
|
|
filter = [] , |
|
|
|
dynamic = False , |
|
|
|
args, |
|
|
|
kwargs |
|
) |
| |
Constructor.
@param servers A list of servers to parse into the tree.
@param paths A list of paths from which to get servers to parse
into the tree.
@param orb If not None, the specified ORB will be used. If None,
the tree object will create its own ORB.
@param filter A list of paths (each a list of strings).
If not empty, then only objects in the paths will
be parsed, to increase speed. If the tail of a
path is a directory, that entire directory will be
parsed. Directories that are not the tail will
only have the next entry in the path parsed.
@param dynamic Use observers to keep the tree up-to-date. For example,
when a component changes state, an observer can notify
RTCTree so that the corresponding object in the tree can
be updated. Currently this only affects components.
@raises NonRootPathError
Definition at line 59 of file tree.py.
def rtctree.tree.RTCTree.add_name_server |
( |
|
self, |
|
|
|
server, |
|
|
|
filter = [] , |
|
|
|
dynamic = None |
|
) |
| |
Parse a name server, adding its contents to the tree.
@param server The address of the name server, in standard
address format. e.g. 'localhost',
'localhost:2809', '59.7.0.1'.
@param filter Restrict the parsed objects to only those in this
path. For example, setting filter to [['/',
'localhost', 'host.cxt', 'comp1.rtc']] will
prevent 'comp2.rtc' in the same naming context
from being parsed.
@param dynamic Override the tree-wide dynamic setting. If not provided,
the value given when the tree was created will be used.
Definition at line 114 of file tree.py.
def rtctree.tree.RTCTree.iterate |
( |
|
self, |
|
|
|
func, |
|
|
|
args = None , |
|
|
|
filter = [] |
|
) |
| |
Call a function on the root node, and recursively all its children.
This is a depth-first iteration.
@param func The function to call. Its declaration must be
'def blag(node, args)', where 'node' is the current node
in the iteration and args is the value of @ref args.
@param args Extra arguments to pass to the function at each iteration.
Pass multiple arguments in as a tuple.
@param filter A list of filters to apply before calling func for each
node in the iteration. If the filter is not True,
@ref func will not be called for that node. Each filter
entry should be a string, representing on of the is_*
properties (is_component, etc), or a function object.
@return The results of the calls to @ref func in a list.
Definition at line 189 of file tree.py.
def rtctree.tree.RTCTree.load_servers_from_env |
( |
|
self, |
|
|
|
filter = [] , |
|
|
|
dynamic = None |
|
) |
| |
Load the name servers environment variable and parse each server in
the list.
@param filter Restrict the parsed objects to only those in this
path. For example, setting filter to [['/',
'localhost', 'host.cxt', 'comp1.rtc']] will
prevent 'comp2.rtc' in the same naming context
from being parsed.
@param dynamic Override the tree-wide dynamic setting. If not provided,
the value given when the tree was created will be used.
Definition at line 209 of file tree.py.