def _getCommand(self, repo_info): platform = repo_info["platform"] # Remove it from repo_info to avoid polution, should clean up later del repo_info["platform"] dir_path = os.path.dirname(os.path.realpath(__file__)) unknowns = getUnknowns() # a not so elegant way of merging info construct if '--info' in unknowns: info_idx = unknowns.index('--info') info = json.loads(unknowns[info_idx + 1]) deepMerge(repo_info, info) del unknowns[info_idx + 1] del unknowns[info_idx] info = getString(json.dumps(repo_info)) command = getPythonInterpreter() + " " + \ os.path.join(dir_path, "harness.py") + " " + \ " --platform " + getString(platform) + \ " --framework " + getString(getArgs().framework) + \ " --info " + info + " " + \ ' '.join([getString(u) for u in unknowns]) if getArgs().env: command = command + " --env " env_vars = getArgs().env.split() for env_var in env_vars: command = command + ' ' + env_var + ' ' return command
def _getCMD(self): args = self._getSavedArgs() unknowns = getUnknowns() dir_path = os.path.dirname(os.path.realpath(__file__)) command = getPythonInterpreter() + " " + dir_path + "/repo_driver.py " + \ ' '.join([self._getString(u) + ' ' + (self._getString(args[u]) if args[u] is not None else "") for u in args]) + ' ' + \ ' '.join([self._getString(u) for u in unknowns]) return command
def _getCommand(self, repo_info): platform = repo_info["platform"] # Remove it from repo_info to avoid polution, should clean up later del repo_info["platform"] dir_path = os.path.dirname(os.path.realpath(__file__)) unknowns = getUnknowns() command = dir_path + "/harness.py " + \ " --platform \'" + platform + "\'" + \ " --framework \'" + getArgs().framework + "\'" + \ (" --info \'" + json.dumps(repo_info) + "\'") + " " + \ ' '.join(['"' + u + '"' for u in unknowns]) return command
def _getUnknownArgs(self): unknowns = getUnknowns() args = {} i = 0 while i < len(unknowns): if len(unknowns[i]) > 2 and unknowns[i][:2] == '--': if i < len(unknowns) - 1 and unknowns[i + 1][:2] != '--': args[unknowns[i]] = unknowns[i + 1] i = i + 1 else: args[unknowns[i]] = None else: # error conditionm, skipping pass i = i + 1 return args
def _getCommand(self, repo_info): platform = repo_info["platform"] # Remove it from repo_info to avoid polution, should clean up later del repo_info["platform"] dir_path = os.path.dirname(os.path.realpath(__file__)) unknowns = getUnknowns() # a not so elegant way of merging info construct if '--info' in unknowns: info_idx = unknowns.index('--info') info = json.loads(unknowns[info_idx + 1]) deepMerge(repo_info, info) del unknowns[info_idx + 1] del unknowns[info_idx] command = getPythonInterpreter() + " " + dir_path + "/harness.py " + \ " --platform \'" + platform + "\'" + \ " --framework \'" + getArgs().framework + "\'" + \ (" --info \'" + json.dumps(repo_info) + "\'") + " " + \ ' '.join(['\'' + u + '\'' for u in unknowns]) return command