Package roslaunch :: Module loader :: Class LoaderContext
[frames] | no frames]

Class LoaderContext

source code

object --+
         |
        LoaderContext

Container for storing current loader context (e.g. namespace, local parameter state, remapping state).

Instance Methods
 
__init__(self, ns, filename, parent=None, params=None, env_args=None, resolve_dict=None, include_resolve_dict=None, arg_names=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
add_param(self, p)
Add a ~param to the context.
source code
 
add_remap(self, remap)
Add a new remap setting to the context.
source code
 
add_arg(self, name, default=None, value=None)
Add 'arg' to existing context.
source code
[(str, str)]
remap_args(self)
Returns: copy of the current remap arguments
source code
LoaderContextjj
include_child(self, ns, filename)
Create child namespace based on include inheritance rules
source code
LoaderContext
child(self, ns)
Returns: A child xml context that inherits from this context
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, ns, filename, parent=None, params=None, env_args=None, resolve_dict=None, include_resolve_dict=None, arg_names=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • ns (str) - namespace
  • filename (str) - name of file this is being loaded from
  • resolve_dict (dict) - (optional) resolution dictionary for substitution args
  • include_resolve_dict (dict) - special resolution dictionary for <include> tags. Must be None if this is not an <include> context.
  • arg_names ([str]) - name of args that have been declared in this context
Overrides: object.__init__

add_param(self, p)

source code 

Add a ~param to the context. ~params are evaluated by any node declarations that occur later in the same context.

Parameters:

add_remap(self, remap)

source code 

Add a new remap setting to the context. if a remap already exists with the same from key, it will be removed

Parameters:
  • remap ((str, str)) - remap setting

add_arg(self, name, default=None, value=None)

source code 

Add 'arg' to existing context. Args are only valid for their immediate context.

remap_args(self)

source code 
Returns: [(str, str)]
copy of the current remap arguments

include_child(self, ns, filename)

source code 

Create child namespace based on include inheritance rules

Parameters:
  • ns (str) - sub-namespace of child context, or None if the child context shares the same namespace
  • filename (str) - name of include file
Returns: LoaderContextjj
A child xml context that inherits from this context

child(self, ns)

source code 
Parameters:
  • ns (str) - sub-namespace of child context, or None if the child context shares the same namespace
Returns: LoaderContext
A child xml context that inherits from this context