22 import sys,os,platform
26 sysinfo = platform.uname()
32 temp_dir = os.environ.get(
'TEMP',
"")
36 temp_dir = os.environ.get(
'TMP',
"")
44 if sys.platform ==
"win32":
45 ns_path = os.path.join(sys.exec_prefix,ns_cmd)
47 ns_path = os.path.join(sys.exec_prefix,
'bin',ns_cmd)
49 if os.path.exists(ns_path):
53 ns_path = os.environ.get(ns_env) + ns_cmd
54 if os.path.exists(ns_path):
57 sys_paths = os.environ.get(
'PATH').
split(
";")
58 for sys_path
in sys_paths:
59 ns_path = sys_path + ns_cmd
60 if os.path.exists(ns_path):
66 if sys.platform ==
"win32":
71 return os.system(delcmd)
75 print "Usage: python rtm-naming.py port_number" 82 log_fname =
"omninames-" + hostname +
".log" 83 log_file = os.path.join(log_path, log_fname)
85 if os.path.exists(log_file):
88 bak_fname =
"omninames-" + hostname +
".bak" 89 bak_file = os.path.join(log_path, bak_fname)
91 if os.path.exists(bak_file):
97 print "Starting omniORB omniNames: ", hostname,
":", port
99 if sys.platform ==
"win32":
100 omniNames =
find_nscmd(
"omniNames.exe",
"OMNI_ROOT")
105 print "Not found omniNames." 109 cmd +=
" -start " + str(port)
110 cmd +=
" -logdir \"" + str(log_path) +
"\"" 115 if __name__ ==
"__main__":
117 if len(sys.argv) == 2:
118 port = int(sys.argv[1])
120 if sys.argv[1] ==
"-u" or sys.argv[1] ==
"-h" or sys.argv[1] ==
"--help":
def split(input, delimiter)
Split string by delimiter.
def find_nscmd(ns_cmd, ns_env="")
def omninames(port="", endpoint="")