The ConfigNode class defines a common skeleton to be used by specific
implementation. It is "purely virtual" (sorry for using
non-pythonic vocabulary there ;-) ).
|
__init__(self,
name,
parent=None,
shell=None)
x.__init__(...) initializes x; see help(type(x)) for signature |
|
|
str|list|None
|
ui_type_number(self,
value=None,
enum=False,
reverse=False)
UI parameter type helper for number parameter type. |
|
|
str|list|None
|
ui_type_string(self,
value=None,
enum=False,
reverse=False)
UI parameter type helper for string parameter type. |
|
|
str|list|None
|
ui_type_bool(self,
value=None,
enum=False,
reverse=False)
UI parameter type helper for boolean parameter type. |
|
|
str|list|None
|
ui_type_loglevel(self,
value=None,
enum=False,
reverse=False)
UI parameter type helper for log level parameter type. |
|
|
str|list|None
|
ui_type_color(self,
value=None,
enum=False,
reverse=False)
UI parameter type helper for color parameter type. |
|
|
str|list|None
|
ui_type_colordefault(self,
value=None,
enum=False,
reverse=False)
UI parameter type helper for default color parameter type. |
|
|
|
ui_setgroup_global(self,
parameter,
value)
This is the backend method for setting parameters in configuration
group 'global'. |
|
|
arbitrary
|
ui_getgroup_global(self,
parameter)
This is the backend method for getting configuration parameters out
of the global configuration group. |
|
|
depends on type
|
ui_eval_param(self,
ui_value,
type,
default)
Evaluates a user-provided parameter value using a given type helper. |
|
|
|
get_type_method(self,
type)
Returns the type helper method matching the type name. |
|
|
|
ui_command_set(self,
group=None,
**parameter)
Sets one or more configuration parameters in the given group. |
|
|
list of str
|
ui_complete_set(self,
parameters,
text,
current_param)
Parameter auto-completion method for user command set. |
|
|
|
ui_command_get(self,
group=None,
*parameter)
Gets the value of one or more configuration parameters in the given
group. |
|
|
list of str
|
ui_complete_get(self,
parameters,
text,
current_param)
Parameter auto-completion method for user command get. |
|
|
|
ui_command_ls(self,
path=None,
depth=None)
Display either the nodes tree relative to path or to the current
node. |
|
|
str
|
_render_tree(self,
root,
margin=None,
depth=None,
do_list=False)
Renders an ascii representation of a tree of ConfigNodes. |
|
|
list of str
|
ui_complete_ls(self,
parameters,
text,
current_param)
Parameter auto-completion method for user command ls. |
|
|
|
|
int
|
_lines_walker(self,
lines,
start_pos)
Using the curses urwid library, displays all lines passed as
argument, and after allowing selection of one line using up, down and
enter keys, returns its index. |
|
|
list of str
|
ui_complete_cd(self,
parameters,
text,
current_param)
Parameter auto-completion method for user command cd. |
|
|
|
ui_command_help(self,
topic=None)
Displays the manual page for a topic, or list available topics. |
|
|
list of str
|
ui_complete_help(self,
parameters,
text,
current_param)
Parameter auto-completion method for user command help. |
|
|
|
ui_command_exit(self)
Exits the command line interface. |
|
|
|
|
list of str
|
ui_complete_bookmarks(self,
parameters,
text,
current_param)
Parameter auto-completion method for user command bookmarks. |
|
|
|
|
|
|
ConfigNode
|
|
str
|
|
|
_set_name(self,
name)
Sets the node's name. |
|
|
str
|
_get_path(self)
Returns:
The absolute path for this node. |
|
|
set of ConfigNode
|
|
|
_get_shell(self)
Gets the shell attached to ConfigNode tree. |
|
|
(str, bool or None)
|
summary(self)
Returns a tuple with a status/description string for this node and a
health flag, to be displayed along the node's name in object trees,
etc. |
|
|
str or ConfigNode or None
|
execute_command(self,
command,
pparams=[],
kparams={})
Execute a user command on the node. |
|
|
|
assert_params(self,
method,
pparams,
kparams)
Checks that positional and keyword parameters match a method
definition, or raise an ExecutionError. |
|
|
list of str
|
list_commands(self)
Returns:
The list of user commands available for this node. |
|
|
method object
|
get_group_getter(self,
group)
Returns:
The getter method for the configuration group. |
|
|
method object
|
get_group_setter(self,
group)
Returns:
The setter method for the configuration group. |
|
|
method
|
|
method or None
|
|
str
|
|
(str, [str...], str)
|
get_command_syntax(self,
command)
Returns:
A list of formatted syntax descriptions for the command: |
|
|
([str...], bool, bool)
|
|
ConfigNode
|
get_root(self)
Returns:
The root node of the nodes tree. |
|
|
|
define_config_group_param(self,
group,
param,
type,
description=None,
writable=True)
Helper to define configuration group parameters. |
|
|
|
list_config_groups(self)
Lists the configuration group names. |
|
|
|
list_group_params(self,
group,
writable=None)
Lists the parameters from group matching the optional param, writable
and type supplied (if none is supplied, returns all group parameters. |
|
|
dict
|
get_group_param(self,
group,
param)
Returns:
A dictionnary for the requested group parameter, with name, writable,
description, group and type fields. |
|
|
bool
|
is_root(self)
Returns:
Wether or not we are a root node. |
|
|
ConfigNode
|
get_child(self,
name)
Returns:
Our child named by name. |
|
|
|
remove_child(self,
child)
Removes a child from our children's list. |
|
|
ConfigNode
|
get_node(self,
path)
Looks up a node by path in the nodes tree. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|