本文整理汇总了Python中git.repo.Repo.close方法的典型用法代码示例。如果您正苦于以下问题:Python Repo.close方法的具体用法?Python Repo.close怎么用?Python Repo.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git.repo.Repo
的用法示例。
在下文中一共展示了Repo.close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from git.repo import Repo [as 别名]
# 或者: from git.repo.Repo import close [as 别名]
def main():
parser=OptionParser(usage=__doc__)
parser.add_option("-l","--iscc-binary", dest="iscc_binary", default=os.path.join(os.path.dirname(__file__),'innosetup','ISCC.exe'), help="Path to ISCC compiler (default: %default)")
parser.add_option("-v","--wapt-version", dest="waptversion", default=waptutils.__version__, help="Wapt edition to build (community, enterprise...). (default: %default)")
parser.add_option("-e","--wapt-edition", dest="waptedition", default='community', help="Wapt edition to build (community, enterprise...). (default: %default)")
parser.add_option("-k","--sign-key", dest="sign_key_path", help="Sign with this key. (default: %default)")
parser.add_option("-w","--sign-key-pwd-path", dest="sign_key_pwd_path", help="Path to password file. (default: %default)")
parser.add_option("-x","--sign-exe-filenames", dest="exe_filenames", help="Additional executables to sign. (default: %default)")
(options,args) = parser.parse_args()
if len(args) != 1:
parser.usage
sys.exit(1)
for iss_path in args:
iss_path = os.path.abspath(iss_path)
(iss_rootname,issext) = os.path.splitext(iss_path)
# add a revision.txt file with git short
r = Repo(search_parent_directories=True)
rev_file = open(os.path.join(os.path.dirname(iss_path), '..', 'revision.txt'), 'w')
rev_file.write(r.head.object.hexsha[:8])
rev_file.close()
r.close()
iss_file = iss_rootname + ".iss"
if options.sign_key_path and options.exe_filenames:
exes = options.exe_filenames.split(',')
for exe_fn in exes:
sign_exe(exe_fn,options.sign_key_path,open(options.sign_key_pwd_path,'rb').read())
cmd = '"%(issc_binary)s" /Dwapt%(waptedition)s %(issfile)s' % {
'issc_binary':options.iscc_binary,
'issfile':iss_file,
'waptedition':options.waptedition.lower()
}
res = setuphelpers.run(cmd)
exe_fn = res.splitlines()[-1]
if options.sign_key_path:
sign_exe(exe_fn,options.sign_key_path,open(options.sign_key_pwd_path,'rb').read())