def run(touch_server_exe_path, ip=None, port=None, auto_exit=False, activity=None, log_file=None, log_path=None, adb_path=None): params = list() params.append(touch_server_exe_path) if ip: params.append('--ip=' + ip) if port: params.append('--port=' + str(port)) if auto_exit: params.append('--autoexit') if activity: params.append('--activity=' + activity) if log_file: params.append('--logfile=' + log_file) if log_path: params.append('--logpath=' + log_path) if adb_path: params.append('--adbPath=' + adb_path) run_command(params, is_shell=True)
def __generate_box(tif_file_name): tesseract = util.run_command(VERSION_COMMAND % 'tesseract') if not tesseract is None: util.run_command(TESSERACT_COMMAND % (tif_file_name, tif_file_name)) print (bcolors.OKGREEN + 'Done: Created ' + \ tif_file_name + '.box file' + bcolors.ENDC) else: raise NotFound('Error: can not run tesseract command')
def __generate_tif(ps_file_name): gs = util.run_command(VERSION_COMMAND % 'gs') if not gs is None: util.run_command(GS_GENERATE % (ps_file_name, ps_file_name)) print (bcolors.OKGREEN + 'Done: Created' + \ ps_file_name + '.tif file' + bcolors.ENDC) else: raise NotFound('Error: can not run gs command')
def __generate_ps(lpi_value, cpi_value, font_name): if util.file_has_x_permission(PATH_PAPS) is not None: ps_content = util.run_command( PS_GENERATE % (lpi_value, cpi_value, font_name, PATH_ALPH)) file_name = font_name + '_' + str(lpi_value) + '_' + str(cpi_value) util.write_in_file(file_name + '/' + file_name + '.ps', ps_content) else: raise NotFound('Error: can not run paps command')
def build(self, csprojPath, args): if not os.path.isfile(self.msbuild): raise Exception('MsBuild.exe not found. path = ' + self.msbuild) start = datetime.datetime.now() print('STARTED BUILD - ' + start.strftime('%Y-%m-%d %H:%M:%S')) params = [self.msbuild, csprojPath] + list(args) return run_command(params)
def build_with_params(self, csprojPath, targets, properties): if not os.path.isfile(self.msbuild): raise Exception('MsBuild.exe not found. path = ' + self.msbuild) start = datetime.datetime.now() print('STARTED BUILD - ' + start.strftime('%Y-%m-%d %H:%M:%S')) params = [self.msbuild, csprojPath] params.append('/t:' + ';'.join(targets)) params.append('/p:' + ';'.join(properties)) return run_command(params)
def restore_components(self, solution_path): args = [self.xam_component_path, 'restore', solution_path] run_command(args)
def install_component(self, xam_file_path): args = [self.xam_component_path, 'install', xam_file_path] run_command(args)