def main(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Routine Import', parents=[testClientParser]) parser.add_argument('routineImportFile', help='path to Routine Import File in .ro format') parser.add_argument('-o', '--routineOutputDir', default=None, help='path to Routine output Dir, GTM only') result = parser.parse_args() print(result) routineImportFile = result.routineImportFile assert os.path.exists(routineImportFile) routineOutputDir = result.routineOutputDir """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) vistARoutineImport = VistARoutineImport() vistARoutineImport.importRoutines(vistAClient, routineImportFile, routineOutputDir)
def testMain(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Global Import Tool', parents=[testClientParser]) parser.add_argument('inputGlobalFile', help='input global file path to be imported to VistA') parser.add_argument( '-t', '--timeout', default=DEFAULT_GLOBAL_IMPORT_TIMEOUT, type=int, help=('global import time out in second, default is %s' % DEFAULT_GLOBAL_IMPORT_TIMEOUT)) result = parser.parse_args() print(result) inputFile = result.inputGlobalFile assert os.path.exists(inputFile) """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_GLOBAL_IMPORT_TIMEOUT) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) vistAGlobalImport = VistAGlobalImport() vistAGlobalImport.importGlobal(vistAClient, inputFile, timeout=result.timeout)
def main(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Routine Export', parents=[testClientParser]) parser.add_argument('-o', '--outputFile', help='Output File Name to store routine export information') parser.add_argument('-a', '--allRoutines', action="store_true", default=False, help='export all routines') parser.add_argument('-r', '--routines', nargs='*', help='only specified routine names') parser.add_argument('-e', '--exclude', nargs='*', default=None, help='exclude specified routine names') result = parser.parse_args(); print (result) outputFilename = result.outputFile outputDir = os.path.dirname(outputFilename) assert os.path.exists(outputDir) """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) isAllRoutines = result.allRoutines vistARoutineExport = VistARoutineExport() if isAllRoutines: vistARoutineExport.exportAllRoutines(vistAClient, outputFilename, result.exclude) else: vistARoutineExport.exportRoutines(vistAClient, outputFilename, result.routines, result.exclude)
def main(): import logging initConsoleLogging(logging.INFO) testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Taskman Utilities', parents=[testClientParser]) parser.add_argument( '-a', '--action', required=True, choices=['Start', 'Stop', 'Shutdown'], help= 'Start:Start Taskman, Stop:Stop Taskman, Shutdown:Shutdown all tasks') result = parser.parse_args() print result """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) taskmanUtil = VistATaskmanUtil() actionMap = { "Start": taskmanUtil.startTaskman, "Stop": taskmanUtil.stopTaskman, "Shutdown": taskmanUtil.shutdownAllTasks } actionMap[result.action](vistAClient)
def main(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description="VistA Routine Export", parents=[testClientParser]) parser.add_argument("-o", "--outputFile", help="Output File Name to store routine export information") parser.add_argument("-a", "--allRoutines", action="store_true", default=False, help="export all routines") parser.add_argument("-r", "--routines", nargs="*", help="only specified routine names") parser.add_argument("-e", "--exclude", nargs="*", default=None, help="exclude specified routine names") parser.add_argument( "-x", "--exception", nargs="*", default=None, help="except specified routine names from the excluded routines" ) result = parser.parse_args() print (result) outputFilename = result.outputFile outputDir = os.path.dirname(outputFilename) assert os.path.exists(outputDir) """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) isAllRoutines = result.allRoutines vistARoutineExport = VistARoutineExport() if isAllRoutines: vistARoutineExport.exportAllRoutines(vistAClient, outputFilename, result.exclude, result.exception) else: vistARoutineExport.exportRoutines( vistAClient, outputFilename, result.routines, result.exclude, result.exception )
def main(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Routine Export', parents=[testClientParser]) parser.add_argument( '-o', '--outputFile', help='Output File Name to store routine export information') parser.add_argument('-a', '--allRoutines', action="store_true", default=False, help='export all routines') parser.add_argument('-r', '--routines', nargs='*', help='only specified routine names') parser.add_argument('-e', '--exclude', nargs='*', default=None, help='exclude specified routine names') parser.add_argument( '-x', '--exception', nargs='*', default=None, help='except specified routine names from the excluded routines') result = parser.parse_args() print(result) outputFilename = result.outputFile outputDir = os.path.dirname(outputFilename) assert os.path.exists(outputDir) """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) isAllRoutines = result.allRoutines vistARoutineExport = VistARoutineExport() if isAllRoutines: vistARoutineExport.exportAllRoutines(vistAClient, outputFilename, result.exclude, result.exception) else: vistARoutineExport.exportRoutines(vistAClient, outputFilename, result.routines, result.exclude, result.exception)
def main(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Global Export', parents=[testClientParser]) parser.add_argument('-o', '--outputDir', required=True, help='output Dir to store global export file in zwr format') result = parser.parse_args(); print (result) outputDir = result.outputDir assert os.path.exists(outputDir) """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) vistAGlobalExport = VistAGlobalExport() vistAGlobalExport.exportAllGlobals(vistAClient, outputDir)
def main(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Global Export', parents=[testClientParser]) parser.add_argument( '-o', '--outputDir', required=True, help='output Dir to store global export file in zwr format') result = parser.parse_args() print(result) outputDir = result.outputDir assert os.path.exists(outputDir) """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) vistAGlobalExport = VistAGlobalExport() vistAGlobalExport.exportAllGlobals(vistAClient, outputDir)
def main(): import logging initConsoleLogging(logging.INFO) testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Taskman Utilities', parents=[testClientParser]) parser.add_argument('-a', '--action', required=True, choices=['Start', 'Stop', 'Shutdown'], help='Start:Start Taskman, Stop:Stop Taskman, Shutdown:Shutdown all tasks') result = parser.parse_args(); print result """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) taskmanUtil = VistATaskmanUtil() actionMap = {"Start": taskmanUtil.startTaskman, "Stop": taskmanUtil.stopTaskman, "Shutdown": taskmanUtil.shutdownAllTasks} actionMap[result.action](vistAClient)
def main(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Routine Import', parents=[testClientParser]) parser.add_argument('routineImportFile', help='path to Routine Import File in .ro format') parser.add_argument('-o', '--routineOutputDir', default=None, help='path to Routine output Dir, GTM only') result = parser.parse_args(); print (result) routineImportFile = result.routineImportFile assert os.path.exists(routineImportFile) routineOutputDir = result.routineOutputDir """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_OUTPUT_LOG_FILE_NAME) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) vistARoutineImport = VistARoutineImport() vistARoutineImport.importRoutines(vistAClient, routineImportFile, routineOutputDir)
def testMain(): testClientParser = createTestClientArgParser() parser = argparse.ArgumentParser(description='VistA Global Import Tool', parents=[testClientParser]) parser.add_argument('inputGlobalFile', help='input global file path to be imported to VistA') parser.add_argument('-t', '--timeout', default=DEFAULT_GLOBAL_IMPORT_TIMEOUT, type=int, help=('global import time out in second, default is %s' % DEFAULT_GLOBAL_IMPORT_TIMEOUT) ) result = parser.parse_args(); print (result) inputFile = result.inputGlobalFile assert os.path.exists(inputFile) """ create the VistATestClient""" testClient = VistATestClientFactory.createVistATestClientWithArgs(result) assert testClient with testClient as vistAClient: logFilename = getTempLogFile(DEFAULT_GLOBAL_IMPORT_TIMEOUT) print "Log File is %s" % logFilename vistAClient.setLogFile(logFilename) vistAGlobalImport = VistAGlobalImport() vistAGlobalImport.importGlobal(vistAClient, inputFile, timeout=result.timeout)
def getDefaultCommitMsgFileByPatchInfo(patchInfo, dir=None): outputFile = installNameToDirName(patchInfo.installName) + ".msg" if dir is None: return getTempLogFile(outputFile) else: return os.path.join(dir, outputFile)