def cmd_rtresurrect(): if sys.platform == 'win32': cmd = ['rtresurrect.bat', wasanbon.setting()['application']['system']] else: cmd = ['rtresurrect', wasanbon.setting()['application']['system']] while True: p = subprocess.Popen(cmd) if p.wait() == 0: break time.sleep(1)
def cmd_rtresurrect(): if sys.platform == 'win32': cmd = ['rtresurrect.bat', wasanbon.setting()['application']['system']] else: cmd = ['rtresurrect', wasanbon.setting()['application']['system']] while True: p = subprocess.Popen(cmd) if p.wait() == 0: break; time.sleep(1)
def cmd_rtstart(file=None): if not file: file = wasanbon.setting()['application']['system'] if sys.platform == 'win32': cmd = ['rtstart.bat', file] else: cmd = ['rtstart', file] while True: p = subprocess.Popen(cmd) if p.wait() == 0: break time.sleep(1)
def cmd_rtstart(file=None): if not file: file = wasanbon.setting()['application']['system'] if sys.platform == 'win32': cmd = ['rtstart.bat', file] else: cmd = ['rtstart', file] while True: p = subprocess.Popen(cmd) if p.wait() == 0: break; time.sleep(1)
def start_java_rtcd(pkg, filepath, verbose=False): if verbose: sys.stdout.write(' - Starting Java rtcd.\n') args = {} #args['env'] = os.environ.copy() args['preexec_fn'] = None if sys.platform == 'win32' else disable_sig args['stdout'] = None if verbose else subprocess.PIPE args['stdin'] = None if verbose else subprocess.PIPE if sys.platform == 'win32': args['creationflags'] = 512 rtm_java_classpath = os.path.join(wasanbon.rtm_home(), 'jar') java_env = os.environ.copy() if not "CLASSPATH" in java_env.keys(): java_env["CLASSPATH"] = os.getcwd() if sys.platform == 'win32': sep = ';' else: sep = ':' for jarfile in os.listdir(rtm_java_classpath): java_env["CLASSPATH"] = java_env["CLASSPATH"] + sep + os.path.join( rtm_java_classpath, jarfile) #java_env["CLASSPATH"]=java_env["CLASSPATH"] + ':bin/LeapTest.jar' rtm_jars = [ j for j in os.listdir(rtm_java_classpath) if j.endswith('.jar') ] for r in pkg.rtcs: if os.path.isdir(os.path.join(r.path, 'jar')): for jarfile in [ j for j in os.listdir(os.path.join(r.path, 'jar')) if j.endswith('.jar') ]: if not jarfile in rtm_jars: java_env["CLASSPATH"] = java_env[ "CLASSPATH"] + sep + os.path.join( r.path, 'jar', jarfile) #print java_env args['env'] = java_env cmd = [wasanbon.setting()['local']['java'], 'rtcd.rtcd', '-f', filepath] return subprocess.Popen(cmd, **args)
def start_java_rtcd(pkg, filepath, verbose=False): if verbose: sys.stdout.write(' - Starting Java rtcd.\n') args = {} #args['env'] = os.environ.copy() args['preexec_fn'] = None if sys.platform == 'win32' else disable_sig args['stdout'] = None if verbose else subprocess.PIPE args['stdin'] = None if verbose else subprocess.PIPE if sys.platform == 'win32': args['creationflags'] = 512 rtm_java_classpath = os.path.join(wasanbon.rtm_home(), 'jar') java_env = os.environ.copy() if not "CLASSPATH" in java_env.keys(): java_env["CLASSPATH"]=os.getcwd() if sys.platform == 'win32': sep = ';' else: sep = ':' for jarfile in os.listdir(rtm_java_classpath): java_env["CLASSPATH"]=java_env["CLASSPATH"] + sep + os.path.join(rtm_java_classpath, jarfile) #java_env["CLASSPATH"]=java_env["CLASSPATH"] + ':bin/LeapTest.jar' rtm_jars = [j for j in os.listdir(rtm_java_classpath) if j.endswith('.jar')] for r in pkg.rtcs: if os.path.isdir(os.path.join(r.path, 'jar')): for jarfile in [j for j in os.listdir(os.path.join(r.path, 'jar')) if j.endswith('.jar')]: if not jarfile in rtm_jars: java_env["CLASSPATH"]=java_env["CLASSPATH"] + sep + os.path.join(r.path, 'jar', jarfile) #print java_env args['env'] = java_env cmd = [wasanbon.setting()['local']['java'], 'rtcd.rtcd', '-f', filepath] return subprocess.Popen(cmd, **args)
def exe_rtstop(file=None): if not file: file = wasanbon.setting()['application']['system'] return rtstop.main([file]) == 0