本文整理汇总了Python中cx.utils.cxPrintFormatter.PrintFormatter.printInfo方法的典型用法代码示例。如果您正苦于以下问题:Python PrintFormatter.printInfo方法的具体用法?Python PrintFormatter.printInfo怎么用?Python PrintFormatter.printInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cx.utils.cxPrintFormatter.PrintFormatter
的用法示例。
在下文中一共展示了PrintFormatter.printInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: try_job_release
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def try_job_release(self):
'''
Create a tagged release and publish to server.
Build, run all tests, publish binaries and
documentation to the web server.
Requires a git_tag as input.
Assumed to be run on the release branch (should work OK on others as well)
'''
if self.options.job_release_I:
PrintFormatter.printHeader('Building release for tag "%s"' % self.controlData().git_tag, 1);
if self.is_main_build():
self.controlData().build_developer_doc = True
self.controlData().build_user_doc = True
self.resetInstallerStep()
self.createUnitTestedPackageStep()
self.integrationTestPackageStep(skip_extra_install_step_checkout=True)
self.cxBuilder.finish()
if self.options.job_release_II:
targetFolder = self.cxInstaller.getTaggedFolderName()
PrintFormatter.printHeader('Creating and publishing release for tag "%s"' % self.controlData().git_tag, 1);
if targetFolder != self.controlData().git_tag:
PrintFormatter.printInfo("Warning: Target folder [%s] not equal to controldata tag [%s]" % (targetFolder, self.controlData().git_tag) )
self.publishTaggedRelease()
if self.is_main_build():
self.publishTaggedDocumentation()
self.cxBuilder.finish()
示例2: _installWindowsNSISExe
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def _installWindowsNSISExe(self, filename):
installfolder = '%s\%s' % (self.install_root, self.system_base_name)
installfolder = installfolder.replace("/", "\\")
filename = filename.replace("/", "\\")
cmd = ["%s" % filename, "/S", "/D=%s" % installfolder]
shell.run(cmd, convertToString=False)
PrintFormatter.printInfo('Installed \n\t%s\nto folder \n\t%s ' % (filename, self.install_root))
示例3: _movePackageToStandardLocation
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def _movePackageToStandardLocation(self):
installer = self.createInstallerObject(installer_path=self._getInitialInstallerPackagePath())
#filepattern = installer.getInstallerPackagePattern()
source = installer.findInstallerFile()
dest = '%s/%s' % (self._getStandardInstallerPackagePath(), os.path.basename(source))
PrintFormatter.printInfo('Copying package files from [%s] to [%s]'%(source,dest))
shell.cp(source, dest)
示例4: _moveDevDocsToStandardLocation
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def _moveDevDocsToStandardLocation(self):
installer_path=self._getInitialInstallerPackagePath()
source = '%s/%s' % (installer_path, "doc/html_dev")
if os.path.exists(source):
dest = '%s/%s' % (self._getStandardInstallerPackagePath(), os.path.basename(source))
PrintFormatter.printInfo('Copying dev doc files from [%s] to [%s]'%(source,dest))
shutil.copytree(source, dest)
示例5: installPackage
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def installPackage(self):
'''
Install the package to the default location on this machine,
based on root_dir if necessary.
'''
PrintFormatter.printHeader('Install package', level=3)
file = self.findInstallerFile()
PrintFormatter.printInfo('Installing file %s' % file)
self._installFile(file)
示例6: publishUserDocs
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def publishUserDocs(self, artefactFolder, targetFolder):
PrintFormatter.printHeader('Publish User Docs to server', level=2)
source = '%s/html_pure' % artefactFolder
if not os.path.exists(source):
PrintFormatter.printInfo("Warning folder don't exist: [%s]" % source)
target = self.assembly.controlData.publish_user_documentation_target
custusx = self._createComponent(cxComponents.CustusX)
target_path = '%s/%s' % (target.path, targetFolder)
self.publish(source, target.server, target.user, target_path)
示例7: publish
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def publish(self, source, server, user, target_path):
PrintFormatter.printInfo('Publishing contents of [%s] to server [%s], remote path [%s]' % (source, server, target_path))
transfer = cx.utils.cxSSH.RemoteFileTransfer()
transfer.connect(server, user)
#transfer.remote_mkdir(targetBasePath)
transfer.remote_rmdir(target_path) # remove old content if any
transfer.copyFolderContentsToRemoteServer(source, target_path);
transfer.close()
示例8: runCTest
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def runCTest(self, path, outpath=None, outfile=None):
'Run all ctest tests at path and write them in ctest xml format to outfile'
if not outfile:
outfile = '%s/CTestResults.xml' % outpath
PrintFormatter.printInfo('Run ctest, results to %s' % outfile)
shell.changeDir(path)
shell.rm_r('%s/Testing/' % path, "[0-9]*")
shell.rm_r(outfile)
shell.run('ctest -D ExperimentalTest --no-compress-output', ignoreFailure=True)
temp_dir = shell.head(os.path.join(path, 'Testing', 'TAG'), 1)
shell.cp(os.path.join(path, 'Testing', temp_dir, 'Test.xml'), '%s' % outfile)
示例9: _installLinuxZip
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def _installLinuxZip(self, filename):
temp_path = '%s/temp/Install' % self.root_dir
shell.removeTree(temp_path)
shell.changeDir(temp_path)
shell.run('tar -zxvf %s' % (filename)) # extract to path
corename = os.path.basename(filename).split('.tar.gz')[0]
unpackedfolder = "%s/%s" % (temp_path, corename)
installfolder = '%s' % self.install_root
shell.changeDir(installfolder)
shell.run('cp -r %s/* %s' % (unpackedfolder, installfolder))
PrintFormatter.printInfo('Installed \n\t%s\nto folder \n\t%s ' % (filename, installfolder))
示例10: searchForFileWithPattern
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def searchForFileWithPattern(self, pattern):
'''
find the file matching the pattern
'''
PrintFormatter.printInfo('Looking for installers with pattern: %s' % pattern)
files = glob.glob(pattern)
cx.utils.cxUtilities.assertTrue(len(files) == 1,
'Found %i install files, requiring 1: \n pattern: %s\n Found:\n %s' %
(len(files), pattern, ' \n'.join(files)))
file = files[0]
return file
示例11: _writeCTestFileForCatchTests
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def _writeCTestFileForCatchTests(self, path, targetFile, testnames):
PrintFormatter.printInfo('Generate ctest file %s'%targetFile)
lines = ['# Autogenerated by CustusX test scripts',
'# Converts Catch unit test framework to one-test-per-process',
'# ctest setup.'
]
catchExe = self._getCatchExecutable(path)
for testname in testnames:
line = 'ADD_TEST("%s" %s "%s")' % (testname, catchExe, testname)
lines.append(line)
cx.utils.cxUtilities.writeToNewFile(filename=targetFile, text='\n'.join(lines))
示例12: _removeLocalTags
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def _removeLocalTags(self):
'''
Remove local tags,
this removes jenkins tags that hides our own.
# http://stackoverflow.com/questions/1841341/remove-local-tags-that-are-no-longer-on-the-remote-repository
'''
PrintFormatter.printInfo('Removing local git tags ...')
shell.changeDir(self.source_custusx_path)
# shell.run('git tag -l | xargs git tag -d') no good on windows
# shell.run('git fetch')
shell.run('git fetch origin --prune --tags')
示例13: findInstallerFile
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def findInstallerFile(self):
'''
Find the full name of the installer file.
'''
pattern = self._getInstallerPackagePattern()
PrintFormatter.printInfo('Looking for installers with pattern: %s' % pattern)
files = glob.glob(pattern)
cx.utils.cxUtilities.assertTrue(len(files) == 1,
'Found %i install files, requiring 1: \n pattern: %s\n Found:\n %s' %
(len(files), pattern, ' \n'.join(files)))
file = files[0]
return file
示例14: resetCustusXDataRepo
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def resetCustusXDataRepo(self, path):
'''
Reset the test data git repo,
and delete the temp subfolder.
This matches the structure of the CustusX git data repo.
'''
PrintFormatter.printInfo('Reset/Clear Data repository...')
# clear local modifications in the data folder - the tests might cause these changes
shell.changeDir(path)
shell.run('git fetch --all')
shell.run('git reset --hard')
tempDir = "%s/temp" % path
shell.removeTree(tempDir)
示例15: createReleaseFolder
# 需要导入模块: from cx.utils.cxPrintFormatter import PrintFormatter [as 别名]
# 或者: from cx.utils.cxPrintFormatter.PrintFormatter import printInfo [as 别名]
def createReleaseFolder(self):
'''
Create a folder containing all the files required for a Release.
Ready to be moved to a distribution server.
'''
PrintFormatter.printHeader('create local release folder', level=2)
targetPath = self._generateReleaseFolderName()
PrintFormatter.printInfo('Creating folder %s' % targetPath)
#shell.run('mkdir -p %s' % targetPath)
shell.makeDirs(targetPath)
installerFile = self.findInstallerFile()
self._copyFile(installerFile, targetPath)
# self.copyReleaseFiles(targetPath)
return targetPath