Skip to content
Snippets Groups Projects
Commit 8c259d14 authored by olivier stasse's avatar olivier stasse
Browse files

Merge pull request #28 from gergondet/topic/ImproveRunCommand

Improve run_command script handling
parents d17639e1 94465e97
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,7 @@ class RosShell(InteractiveConsole):
if __name__ == '__main__':
import optparse
import os.path
manifest = roslib.manifest.load_manifest('dynamic_graph_bridge')
rospy.init_node('run_command', argv=sys.argv)
sys.argv = rospy.myargv(argv=None)
......@@ -82,12 +83,14 @@ if __name__ == '__main__':
if args[:]:
infile = args[0]
source = open(infile).read()
if not sh.client:
print("Connection to remote server has been lost.")
sys.exit(1)
response = sh.scriptClient(infile)
if not response:
print("Error while file parsing ")
if os.path.isfile(infile):
if not sh.client:
print("Connection to remote server has been lost.")
sys.exit(1)
response = sh.scriptClient(os.path.abspath(infile))
if not response:
print("Error while file parsing ")
else:
print("Provided file does not exist: %s"%(infile))
else:
sh.interact("Interacting with remote server.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment