本文整理汇总了Python中utils.Utils.run_in_dir方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.run_in_dir方法的具体用法?Python Utils.run_in_dir怎么用?Python Utils.run_in_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils.Utils
的用法示例。
在下文中一共展示了Utils.run_in_dir方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __gitTag
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import run_in_dir [as 别名]
def __gitTag(self, i, tagName):
cmd = "git clone {url} {d}".format(url=i.url, d=shellquote(i.local_dir))
tagCmd = "git checkout {tag}".format(tag=tagName)
try:
Utils.run(cmd)
Utils.run_in_dir(tagCmd, i.local_dir)
except:
print "failed to clone from {url}".format(url=i.url)
sys.exit(1)
示例2: __build
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import run_in_dir [as 别名]
def __build(self, i, cmd):
print "\t Getting file..."
fnp = Utils.get_file_if_size_diff(i.url, self.paths.ext_tars)
Utils.clear_dir(i.build_dir)
Utils.untar(fnp, i.build_dir)
try:
Utils.run_in_dir(cmd, i.build_sub_dir)
except:
#Utils.rm_rf(i.local_dir)
sys.exit(1)
示例3: remakeNJHseqProject
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import run_in_dir [as 别名]
def remakeNJHseqProject(self, subProjectDir):
makeCmd = ""
cmd = """
if [ -f .git ]; then git pull; fi
&& if [ -f .gitmodules ]; then git submodule init && git submodule update; fi
&& ./configure.py -externalLibDir {EXT_LOC}
&& ./setup.py --compfile compfile.mk --outMakefile makefile-common.mk --overWrite
&& make clean && make -j {NUMCORES}
&& if [ -d $(make printInstallDir) ]; then rm -rf $(make printInstallDir); fi
&& mkdir -p $(make printInstallDir)
&& make -j {NUMCORES} install""".format(EXT_LOC = self.externalLoc, NUMCORES = self.numCores)
cmd = cmd + makeCmd
cmd = " ".join(cmd.split())
Utils.run_in_dir(cmd, subProjectDir)
示例4: __buildFromGitTag
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import run_in_dir [as 别名]
def __buildFromGitTag(self, i, cmd, tagName):
if os.path.exists(i.build_dir):
print "pulling from {url}".format(url=i.url)
pCmd = "git checkout master && git pull && git checkout " + tagName
try:
Utils.run_in_dir(pCmd, i.build_dir)
except:
print "failed to pull from {url}".format(url=i.url)
sys.exit(1)
else:
print "cloning from {url}".format(url=i.url)
cCmd = "git clone {url} {d}".format(url=i.url, d=i.build_dir)
tagCmd = "git checkout {tag}".format(tag=tagName)
try:
print self.paths.ext_build
Utils.run_in_dir(cCmd, self.paths.ext_build)
Utils.run_in_dir(tagCmd, i.build_dir)
except:
print "failed to clone from {url}".format(url=i.url)
sys.exit(1)
try:
Utils.run_in_dir(cmd, i.build_dir)
except:
Utils.rm_rf(i.local_dir)
sys.exit(1)
示例5: __buildFromGitBranch
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import run_in_dir [as 别名]
def __buildFromGitBranch(self, i, cmd, branchName):
if os.path.exists(i.build_dir):
print "pulling from {url}".format(url=i.url)
pCmd = "git checkout " + branchName + " && git pull"
try:
Utils.run_in_dir(pCmd, i.build_dir)
except:
print "failed to pull from {url} with {cmd}".format(url=i.url, cmd = pCmd)
sys.exit(1)
else:
print "cloning from {url}".format(url=i.url)
cCmd = "git clone -b "+ branchName + " {url} {d}".format(url=i.url, d=i.build_dir)
try:
print self.paths.ext_build
Utils.run_in_dir(cCmd, self.paths.ext_build)
except:
print "failed to clone from {url}".format(url=i.url)
sys.exit(1)
try:
Utils.run_in_dir(cmd, i.build_dir)
except:
Utils.rm_rf(i.local_dir)
sys.exit(1)
示例6: __buildFromGit
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import run_in_dir [as 别名]
def __buildFromGit(self, i, cmd):
if os.path.exists(i.build_dir):
print "pulling from {url}".format(url=i.url)
pCmd = "git pull"
try:
Utils.run_in_dir(pCmd, i.build_dir)
except:
print "failed to pull from {url}".format(url=i.url)
sys.exit(1)
else:
print "cloning from {url}".format(url=i.url)
cCmd = "git clone {url} {d}".format(url=i.url, d=i.build_dir)
try:
print self.paths.ext_build
Utils.run_in_dir(cCmd, self.paths.ext_build)
except:
print "failed to clone from {url}".format(url=i.url)
sys.exit(1)
try:
Utils.run_in_dir(cmd, i.build_dir)
except:
Utils.rm_rf(i.local_dir)
sys.exit(1)