def getDBDict(cmd): ret = execCommand(cmd) retstr = ret.decode('utf-8') if isWin(): retstr = retstr.translate(str.maketrans({"\\": r"\\"})) ret = json.loads(retstr) if ret['Status'] != 'OK': log_msg(ret['Status']) raise FileNotFoundError return ret
def retFileLoc(bstdout): if bstdout == None: return None retstr = bstdout.decode('utf-8') if isWin(): retstr = retstr.translate(str.maketrans({"\\": r"\\"})) fileloc = json.loads(retstr) if fileloc['Status'] != 'OK': log_msg(fileloc['Status']) raise FileNotFoundError return fileloc['File_name']
def retFileLoc( bstdout ): if bstdout == None: return None retstr = bstdout.decode('utf-8') if isWin(): retstr = retstr.translate(str.maketrans({"\\": r"\\"})) fileloc = json.loads( retstr ) if fileloc['Status'] != 'OK': log_msg( fileloc['Status'] ) raise FileNotFoundError return fileloc['data']['File_name']
def getDBList(translnm,args=None): cmd = getODCommand(dbmanexe,args) cmd.append( '--json' ) cmd.append( '--list' ) cmd.append( translnm ) ret = execCommand( cmd ) retstr = ret.decode('utf-8') if isWin(): retstr = retstr.translate(str.maketrans({"\\": r"\\"})) db = json.loads( retstr ) if db['Status'] != 'OK': log_msg( db['Status'] ) raise FileNotFoundError return db['data']
def getDBList(translnm, args=None): cmd = getODCommand(dbmanexe, args) cmd.append('--json') cmd.append('--list') cmd.append(translnm) ret = execCommand(cmd) retstr = ret.decode('utf-8') if isWin(): retstr = retstr.translate(str.maketrans({"\\": r"\\"})) ret = json.loads(retstr) if ret['Status'] != 'OK': log_msg(ret['Status']) raise FileNotFoundError return ret
def log_subprocess_output(pipe): for line in iter(pipe.readline, b''): log_msg(line.decode('utf-8').strip('\n'))