本文整理汇总了Python中utils.Utils.rm_rf方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.rm_rf方法的具体用法?Python Utils.rm_rf怎么用?Python Utils.rm_rf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils.Utils
的用法示例。
在下文中一共展示了Utils.rm_rf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __buildFromGitTag
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import rm_rf [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)
示例2: __build
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import rm_rf [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: rmDirsForLib
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import rm_rf [as 别名]
def rmDirsForLib(self,lib):
if lib not in self.setUps:
print CT.boldBlack( "Unrecognized lib: ") + CT.boldRed(lib)
else:
p = self.__path(lib)
if p.build_dir:
print "Removing " + CT.boldBlack(p.build_dir)
Utils.rm_rf(p.build_dir)
if p.local_dir:
print "Removing " + CT.boldBlack(p.local_dir)
Utils.rm_rf(p.local_dir)
示例4: __buildFromGitBranch
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import rm_rf [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)
示例5: __buildFromGit
# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import rm_rf [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)