Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 import argparse
00036 import os
00037 import sys
00038
00039 import roslib
00040 roslib.load_manifest('rqt_gui')
00041
00042 from qt_gui.main import Main as Base
00043
00044
00045 class Main(Base):
00046
00047 def __init__(self, filename=None):
00048 super(Main, self).__init__(filename, 'rqt_gui')
00049 self._plugin_cache = None
00050
00051 def _add_arguments(self, parser):
00052 super(Main, self)._add_arguments(parser)
00053
00054 parser.add_argument('-c', '--cache-plugins', dest='cache_plugins', default=False, action='store_true',
00055 help='cache list of available plugins (trading faster start-up for not up-to-date plugin list)')
00056
00057
00058 for arg in ['__name', '__log', '__ip', '__hostname', '__master', '__ns']:
00059 parser.add_argument(arg, nargs='?', help=argparse.SUPPRESS)
00060
00061 def _add_plugin_providers(self):
00062 if self._options.cache_plugins:
00063 from .ros_plugin_provider_cache import RosPluginProviderCache
00064 self._plugin_cache = RosPluginProviderCache()
00065 self._plugin_cache.load()
00066
00067 try:
00068 from .rospkg_plugin_provider import RospkgPluginProvider
00069 ActualRosPluginProvider = RospkgPluginProvider
00070 except ImportError:
00071 from .roslib_plugin_provider import RoslibPluginProvider
00072 ActualRosPluginProvider = RoslibPluginProvider
00073
00074
00075 from qt_gui.recursive_plugin_provider import RecursivePluginProvider
00076 self.plugin_providers.append(ActualRosPluginProvider('qt_gui', 'qt_gui_py::Plugin'))
00077 self.plugin_providers.append(RecursivePluginProvider(ActualRosPluginProvider('qt_gui', 'qt_gui_py::PluginProvider')))
00078 self.plugin_providers.append(RecursivePluginProvider(ActualRosPluginProvider('rqt_gui', 'rqt_gui_py::PluginProvider')))
00079
00080 def _caching_hook(self):
00081 if self._plugin_cache is not None:
00082 self._plugin_cache.save()
00083
00084 def _add_reload_paths(self, reload_importer):
00085 super(Main, self)._add_reload_paths(reload_importer)
00086 reload_importer.add_reload_path(os.path.join(os.path.dirname(__file__), *('..',) * 4))
00087
00088
00089 if __name__ == '__main__':
00090 main = Main()
00091 sys.exit(main.main())