本文整理汇总了Python中VistATestClient.VistATestClientFactory类的典型用法代码示例。如果您正苦于以下问题:Python VistATestClientFactory类的具体用法?Python VistATestClientFactory怎么用?Python VistATestClientFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VistATestClientFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
def main():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='FOIA Patch Sequence Analyzer',
parents=[testClientParser])
parser.add_argument('-p', '--patchFileDir', required=True,
help='input file path to the folder that contains all the FOIA patches')
parser.add_argument('-l', '--logDir', required=True,
help='Output dirctory to store all log file information')
parser.add_argument('-i', '--install', default=False, action="store_true",
help = 'whether to install Patch or not')
group = parser.add_mutually_exclusive_group()
group.add_argument('-n', '--numOfPatch', default=1,
help="input All for all patches, "
"otherwise just enter number, default is 1")
group.add_argument('-u', '--upToPatch',
help="install patches up to specified install name")
group.add_argument('-o', '--onlyPatch',
help='install specified patch and required patches only'
', this option will ignore the CSV dependencies')
parser.add_argument('-d', '--duz', default=17, type=int,
help='installer\'s VistA instance\'s DUZ')
result = parser.parse_args();
print (result)
inputPatchDir = result.patchFileDir
assert os.path.exists(inputPatchDir)
outputDir = result.logDir
assert os.path.exists(outputDir)
""" create the VistATestClient"""
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
testClient2 = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
initConsoleLogging()
with testClient as vistAClient:
patchSeqApply = PatchSequenceApply(vistAClient, outputDir)
patchSeqApply._duz = result.duz
assert testClient2
with testClient2 as vistAClient2:
patchSeqApply._testClient2 = vistAClient2
if result.upToPatch:
patchSeqApply.generatePatchSequence(inputPatchDir,
result.upToPatch, True)
else:
patchSeqApply.generatePatchSequence(inputPatchDir, result.onlyPatch)
if result.install:
if result.onlyPatch:
patchSeqApply.applyPatchSequenceByNumber("All")
elif result.upToPatch:
patchSeqApply.applyPatchSequenceByInstallName(result.upToPatch)
else:
patchSeqApply.applyPatchSequenceByNumber(result.numOfPatch)
示例2: main
def main():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='FOIA Patch Sequence Analyzer',
parents=[testClientParser])
parser.add_argument('-p', '--patchFileDir', required=True,
help='input file path to the folder that contains all the FOIA patches')
parser.add_argument('-l', '--logDir', required=True,
help='Output dirctory to store all log file information')
parser.add_argument('-i', '--install', default=False, action="store_true",
help = 'whether to install KIDS Patch or not')
parser.add_argument('-n', '--numOfPatch', required=False, default=1,
help="input All for all patches, otherwise just enter number, default is 1")
result = parser.parse_args();
print (result)
inputPatchDir = result.patchFileDir
assert os.path.exists(inputPatchDir)
outputDir = result.logDir
assert os.path.exists(outputDir)
""" create the VistATestClient"""
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
with testClient as vistAClient:
kidsPatchApply = KIDSPatchSequenceApply(vistAClient, outputDir)
kidsPatchApply.generateKIDSPatchSequence(inputPatchDir)
if result.install:
kidsPatchApply.applyKIDSPatchSequence(result.numOfPatch)
示例3: main
def main():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='VistA Data Extractor',
parents=[testClientParser])
parser.add_argument('-o', '--outputDir', required=True,
help='output Dir to store global/routine export files')
parser.add_argument('-r', '--vistARepo', required=True,
help='path to the top directory of VistA-FOIA repository')
parser.add_argument('-l', '--logDir', required=True,
help='path to the top directory to store the log files')
parser.add_argument('-ro', '--routineOutDir', default=None,
help='path to the directory where GT. M stores routines')
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:
vistADataExtractor = VistADataExtractor(result.vistARepo,
outputDir,
result.logDir,
result.routineOutDir)
vistADataExtractor.extractData(testClient)
示例4: createTestClient
def createTestClient():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description="Default KIDS Installer", parents=[testClientParser])
result = parser.parse_args()
print(result)
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
return testClient
示例5: main
def main():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='Default KIDS Installer',
parents=[testClientParser])
parser.add_argument('kidsFile', help='path to KIDS Build file')
parser.add_argument('-l', '--logFile', default=None, help='path to logFile')
parser.add_argument('-r', '--reinstall', default=False, action='store_true',
help='whether re-install the KIDS even it is already installed')
parser.add_argument('-g', '--globalFiles', default=None, nargs='*',
help='list of global files that need to import')
result = parser.parse_args();
print (result)
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
initConsoleLogging()
with testClient:
kidsFile = os.path.abspath(result.kidsFile)
from KIDSBuildParser import KIDSBuildParser
kidsParser = KIDSBuildParser(None)
kidsParser.unregisterSectionHandler(KIDSBuildParser.ROUTINE_SECTION)
kidsParser.parseKIDSBuild(kidsFile)
installNameList = kidsParser.installNameList
installName = installNameList[0]
multiBuildList = installNameList
if len(installNameList) == 1:
multiBuildList = None
defaultKidsInstall = DefaultKIDSBuildInstaller(kidsFile,
installName,
logFile=result.logFile,
multiBuildList=multiBuildList,
globals=result.globalFiles)
defaultKidsInstall.runInstallation(testClient, result.reinstall)
示例6: testMountDisMountLocalDb
def testMountDisMountLocalDb():
from VistATestClient import createTestClientArgParser
from VistATestClient import VistATestClientFactory
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description="InterSystem Cache Mount Dismount Test", parents=[testClientParser])
parser.add_argument("-p", "--dirPath", required=True, help="Enter directory path for the local database")
parser.add_argument(
"-a",
"--action",
choices=["M", "D"],
required=True,
type=str,
help="M: mount the database, D: dismount the database. "
"Make sure InterSystem ^DATABASE routine is accessable via"
" specified namespace.",
)
result = parser.parse_args()
print result
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
with testClient:
if result.action == "D":
logging.info("Dismount LocalDB: %s" % result.dirPath)
dismountLocalDatabase(result.dirPath, testClient)
else:
logging.info("mount LocalDB: %s" % result.dirPath)
mountLocalDatabase(result.dirPath, testClient)
示例7: createTestClient
def createTestClient():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description="VistA Patch Info Query", parents=[testClientParser])
result = parser.parse_args()
print (result)
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
return testClient
示例8: main
def main():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='Default KIDS Installer',
parents=[testClientParser])
parser.add_argument('kidsFile', metavar='K', help='path to KIDS Build file')
parser.add_argument('installName', metavar='I', help='kids install name')
parser.add_argument('-l', '--logFile', default=None, help='path to logFile')
parser.add_argument('-r', '--reinstall', default=False, action='store_true',
help='whether re-install the KIDS even it is already installed')
parser.add_argument('-m', '--multiBuildList', default=None, nargs='*',
help='list of multibuild install names')
parser.add_argument('-g', '--globalFiles', default=None, nargs='*',
help='list of global files that need to import')
result = parser.parse_args();
print (result)
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
initConsoleLogging()
with testClient:
kidsFile = os.path.abspath(result.kidsFile)
defaultKidsInstall = DefaultKIDSPatchInstaller(kidsFile,
result.installName,
logFile=result.logFile,
multiBuildList=result.multiBuildList,
globals=result.globalFiles)
defaultKidsInstall.runInstallation(testClient, result.reinstall)
示例9: main
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)
示例10: main
def main():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='FOIA Patch Sequence Analyzer',
parents=[testClientParser])
parser.add_argument('-f', '--foiaBranch', required=True,
help='input the branch name from which the global files are downloaded')
parser.add_argument('-r', '--foiaRemote', required=False, default="https://raw.githubusercontent.com/OSEHRA-Sandbox/VistA-M/",
help='input the VistA-M repository from which the global files are downloaded, must be a link to the raw data.\
Default remote is: https://raw.githubusercontent.com/OSEHRA-Sandbox/VistA-M/ ')
parser.add_argument('-t', '--tmpDir', required=True,
help='input the filepath to a directory to download the necessary global files')
parser.add_argument('-g', '--gtmDir', required=False,
help='input the filepath to a directory where GT.M stores its routines')
parser.add_argument('-i', '--install', required=False, action="store_true",
help='Attempt to install global files with ^ZGI?')
parser.add_argument('-l', '--log', required=False,
help='File to which I would log VistA communication')
result = parser.parse_args();
""" create the VistATestClient"""
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
initConsoleLogging()
if result.log: testClient.setLogFile(result.log)
with testClient as vistaClient:
update = updateMFSGlobals()
update.updateMFSGlobalFiles(vistaClient,result.foiaBranch, result.foiaRemote,result.tmpDir, result.gtmDir, result.install)
示例11: main
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()
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)
示例12: main
def main():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='VistA M Component Extractor',
parents=[testClientParser])
parser.add_argument('-o', '--outputDir', required=True,
help='output Dir to store global/routine export files')
parser.add_argument('-r', '--vistARepo', required=True,
help='path to the top directory of VistA-M repository')
parser.add_argument('-l', '--logDir', required=True,
help='path to the top directory to store the log files')
parser.add_argument('-ro', '--routineOutDir', default=None,
help='path to the directory where GT. M stores routines')
parser.add_argument('-sx', '--serialize', default=False, action="store_true",
help = 'export the globals serially (Needed on on single-user Cache instace)')
result = parser.parse_args();
print (result)
outputDir = result.outputDir
assert os.path.exists(outputDir)
initConsoleLogging()
""" create the VistATestClient"""
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
with testClient as vistAClient:
vistADataExtractor = VistADataExtractor(result.vistARepo,
outputDir,
result.logDir,
result.routineOutDir,
serialExport = result.serialize)
vistADataExtractor.extractData(testClient)
示例13: _createTestClient
def _createTestClient(self):
testClientConfig = self._config['VistA_Connection']
system = testClientConfig['system']
namespace = testClientConfig.get('namespace', DEFAULT_NAMESPACE)
username = testClientConfig.get('username', None)
password = testClientConfig.get('password', None)
prompt = testClientConfig.get('prompt', None)
return VistATestClientFactory.createVistATestClient(system,
prompt=prompt,
namespace=namespace,
instance=self._instance,
username=username,
password=password)
示例14: dispatch
def dispatch(self):
# expectConn = VistATestClientFactory.createVistATestClient(self._system, namespace=self._namespace)
# if not expectConn:
# return
# FileManGlobalAttributes.listFileManFileAttributes(expectConn, self._fileManFile, 3,
# os.path.join(self._logDir, self._fileManFile + ".custom"),
# os.path.join(self._logDir, self._fileManFile + ".customlog"))
expectConn = VistATestClientFactory.createVistATestClient(self._system, namespace=self._namespace)
if not expectConn:
return
FileManGlobalAttributes.listFileManFileAttributes(expectConn, self._fileManFile, 1,
os.path.join(self._logDir, self._fileManFile + ".schema"),
os.path.join(self._logDir, self._fileManFile + ".log"))
示例15: main
def main():
testClientParser = createTestClientArgParser()
parser = argparse.ArgumentParser(description='VistA Initialize FileMan Utilities',
parents=[testClientParser])
parser.add_argument('roFile', help="routine import file in ro format")
result = parser.parse_args();
print (result)
""" create the VistATestClient"""
testClient = VistATestClientFactory.createVistATestClientWithArgs(result)
assert testClient
with testClient as vistAClient:
logFilename = getTempLogFile()
print "Log File is %s" % logFilename
initConsoleLogging()
vistAClient.setLogFile(logFilename)
installFileMan22_2(vistAClient, result.roFile)