def test_interactive(): import roslib # make sure that it's part of high-level API assert not roslib.is_interactive(), "interactive should be false by default" for v in [True, False]: roslib.set_interactive(v) assert v == roslib.is_interactive()
def test_interactive(): import roslib # make sure that it's part of high-level API assert not roslib.is_interactive( ), 'interactive should be false by default' for v in [True, False]: roslib.set_interactive(v) assert v == roslib.is_interactive()
def test_interactive(self): import roslib import roslib.scriptutil # make sure that it's part of high-level API self.failIf(roslib.is_interactive(), "interactive should be false by default") for v in [True, False]: roslib.set_interactive(v) self.assertEquals(v, roslib.is_interactive()) self.assertEquals(v, roslib.scriptutil.is_interactive())
#!/usr/bin/env python import roslib; roslib.load_manifest('rosh') # this changes the behavior of rospy/roslaunch/etc... on SIGINT to just be a normal KeyboardInterrupt roslib.set_interactive(True) import rosh rosh.rosh_init() # import all symbols after initialization from rosh import * import os, sys plugins = sys.argv[1:] for p in plugins: load(p, globals()) # load the user's roshrc file, if present import roslib.rosenv as _rosenv _roshrcp = os.path.join(_rosenv.get_ros_home(), 'rosh', 'roshrc.py') if os.path.isfile(_roshrcp): print "loading roshrc" try: _f = open(_roshrcp) _plugins_copy = plugins[:] exec _f.read() if plugins and plugins != _plugins_copy: for p in plugins: try: load(p, globals())