Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 import sys,os,platform
00018 import time
00019 import commands
00020
00021 nsport="2809"
00022 sysinfo = platform.uname()
00023 hostname= sysinfo[1]
00024 plat=sys.platform
00025
00026 if plat == "win32":
00027 os.system("rd /S /Q SimpleService")
00028 os.system("rd /S /Q SimpleService__POA")
00029 os.system("omniidl.exe -bpython MyService.idl")
00030 os.system("start python ..\\..\\..\\bin\\rtm-naming.py")
00031 os.system("start python MyServiceConsumer.py")
00032 os.system("start python MyServiceProvider.py")
00033 time.sleep(3)
00034 os.system("python Connector.py")
00035
00036 else:
00037 os.system('rm -rf SimpleService*')
00038 os.system('omniidl -bpython MyService.idl')
00039 status,term=commands.getstatusoutput("which xterm")
00040 term += " -e"
00041 if status != 0:
00042 status,term=commands.getstatusoutput("which kterm")
00043 term += " -e"
00044
00045 if status != 0:
00046 status,term=commands.getstatusoutput("which uxterm")
00047 term += " -e"
00048
00049 if status != 0:
00050 status,term=commands.getstatusoutput("which gnome-terminal")
00051 term += " -x"
00052
00053 if status != 0:
00054 print "No terminal program (kterm/xterm/gnome-terminal) exists."
00055 sys.exit(0)
00056
00057 path = None
00058 for p in sys.path:
00059 if os.path.exists(os.path.join(p,"OpenRTM_aist")):
00060 path = os.path.join(p,"OpenRTM_aist","utils","rtm-naming")
00061 break
00062 if path is None:
00063 print "rtm-naming directory not exist."
00064 sys.exit(0)
00065
00066 os.system('python %s/rtm-naming.py &'%path)
00067 os.system('%s python MyServiceConsumer.py &'%term)
00068 os.system('%s python MyServiceProvider.py &'%term)
00069 time.sleep(3)
00070 os.system("python Connector.py")