00001
00002 from roslaunch.loader import LoaderContext
00003
00004 class LaunchtreeContext(LoaderContext):
00005
00006 def __init__(self, ns, filename, config=None, parent=None, params=None, env_args=None, resolve_dict=False, include_resolve_dict=None, arg_names=None):
00007 super(LaunchtreeContext, self).__init__(ns, filename, parent, params, env_args, resolve_dict, include_resolve_dict, arg_names)
00008 self._config = config
00009
00010 def add_arg(self, name, default=None, value=None, doc=None):
00011 result = super(LaunchtreeContext, self).add_arg(name, default, value, doc)
00012 if self._config is not None:
00013 self._config.add_arg(name, default, value, doc)
00014 return result
00015
00016 def add_remap(self, remap):
00017 result = super(LaunchtreeContext, self).add_remap(remap)
00018 if self._config is not None:
00019 self._config.add_remap(remap[0], remap[1])
00020 return result
00021
00022 def add_rosparam(self, command, filename, unique_name):
00023 if self._config is not None:
00024 self._config.add_rosparam(command, filename, unique_name)
00025
00026 def child(self, ns):
00027 result = super(LaunchtreeContext, self).child(ns)
00028 return LaunchtreeContext(result.ns, result.filename, self._config, result.parent, result.params, result.env_args, result.resolve_dict, result.include_resolve_dict, result.arg_names)