本文整理汇总了Python中util.verify_path_exists函数的典型用法代码示例。如果您正苦于以下问题:Python verify_path_exists函数的具体用法?Python verify_path_exists怎么用?Python verify_path_exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了verify_path_exists函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fix_from_ver
def fix_from_ver(ver, all_vers, all_vers_s3):
to_delete = {}
for v in all_vers:
if v >= ver:
to_delete[v] = True
for v in all_vers_s3:
if v >= ver:
to_delete[v] = True
to_delete = to_delete.keys()
if len(to_delete) > 10: # safety check
to_delete.sort()
to_delete.reverse()
print(to_delete)
print("won't delete because too many version: %d" % len(to_delete))
return
map(delete_ver, to_delete)
src_path = os.path.join("..", "sumatrapdf_buildbot")
verify_path_exists(src_path)
os.chdir(src_path)
run_cmd_throw("svn", "update", "-r", str(ver))
print("Finished fixing")
sys.exit(1)
示例2: main
def main():
verify_started_in_right_directory()
# to avoid problems, we build a separate source tree, just for the buildbot
src_path = os.path.join("..", "sumatrapdf_buildbot")
verify_path_exists(src_path)
conf = load_config()
s3.set_secrets(conf.aws_access, conf.aws_secret)
s3.set_bucket("kjkpub")
os.chdir(src_path)
#build_version("6698", skip_release=True)
#build_index_html()
#build_sizes_json()
#build_curr(force=True)
buildbot_loop()
示例3: main
def main():
cert_path() # early check and ensures value is memoized
verify_efi_present()
verify_started_in_right_directory()
# to avoid problems, we build a separate source tree, just for the buildbot
src_path = os.path.join("..", "sumatrapdf_buildbot")
verify_path_exists(src_path)
conf = load_config()
s3.set_secrets(conf.aws_access, conf.aws_secret)
s3.set_bucket("kjkpub")
os.chdir(src_path)
# test_email_tests_failed()
#build_version("8190", skip_release=True)
# test_build_html_index()
# build_sizes_json()
# build_curr(force=True)
buildbot_loop()
示例4: zip_one_file
def zip_one_file(dir, to_pack, zip_name):
verify_path_exists(dir)
# for the benefit of pigz, we have to cd to the directory, because
# we don't control the name of the file inside created zip file - it's
# the same as path of the file we're compressing
curr_dir = os.getcwd()
os.chdir(dir)
verify_path_exists(to_pack)
util.delete_file(zip_name) # ensure destination doesn't exist
try:
# -11 for zopfil compression
# --keep to not delete the source file
# --zip to create a single-file zip archive
# we can't control the name of the file pigz will create, so rename
# to desired name after it's created
pigz_dst = to_pack + ".zip"
util.delete_file(pigz_dst)
run_cmd_throw("pigz", "-11", "--keep", "--zip", to_pack)
print("Compressed using pigz.exe")
if pigz_dst != zip_name:
print("moving %s => %s" % (pigz_dst, zip_name))
shutil.move(pigz_dst, zip_name)
except:
# if pigz.exe is not in path, use regular zip compression
zip_file(zip_name, to_pack, to_pack, compress=True)
print("Compressed using regular zip")
verify_path_exists(zip_name)
os.chdir(curr_dir)
示例5: src_dir
def src_dir():
d = os.path.join(g_script_dir, "..", "..", "src")
return util.verify_path_exists(os.path.realpath(d))
示例6: cert_path
def cert_path():
scripts_dir = os.path.realpath(os.path.dirname(__file__))
cert_path = os.path.join(scripts_dir, "cert.pfx")
return verify_path_exists(cert_path)
示例7: main
def main():
global upload
if len(args) != 0:
usage()
verify_started_in_right_directory()
if build_prerelease:
if svn_revision is None:
run_cmd_throw("svn", "update")
(out, err) = run_cmd_throw("svn", "info")
ver = str(parse_svninfo_out(out))
else:
# allow to pass in an SVN revision, in case SVN itself isn't available
ver = svn_revision
else:
ver = extract_sumatra_version(os.path.join("src", "Version.h"))
log("Version: '%s'" % ver)
# don't update translations for release versions to prevent Trunk changes
# from messing up the compilation of a point release on a branch
if g_new_translation_system and build_prerelease and not skip_transl_update:
trans_upload.uploadStringsIfChanged()
changed = trans_download.downloadAndUpdateTranslationsIfChanged()
# Note: this is not a perfect check since re-running the script will
# proceed
if changed:
print("\nNew translations have been downloaded from apptranslator.og")
print("Please verify and checkin src/Translations_txt.cpp and strings/translations.txt")
sys.exit(1)
filename_base = "SumatraPDF-%s" % ver
if build_prerelease:
filename_base = "SumatraPDF-prerelease-%s" % ver
s3_dir = "sumatrapdf/rel"
if build_prerelease:
s3_dir = "sumatrapdf/prerel"
if upload_tmp:
upload = True
s3_dir += "tmp"
if upload:
log("Will upload to s3 at %s" % s3_dir)
conf = load_config()
s3.set_secrets(conf.aws_access, conf.aws_secret)
s3.set_bucket("kjkpub")
s3_prefix = "%s/%s" % (s3_dir, filename_base)
s3_exe = s3_prefix + ".exe"
s3_installer = s3_prefix + "-install.exe"
s3_pdb_zip = s3_prefix + ".pdb.zip"
s3_exe_zip = s3_prefix + ".zip"
s3_files = [s3_exe, s3_installer, s3_pdb_zip]
if not build_prerelease:
s3_files.append(s3_exe_zip)
cert_pwd = None
cert_path = os.path.join("scripts", "cert.pfx")
if upload:
map(s3.verify_doesnt_exist, s3_files)
verify_path_exists(cert_path)
conf = load_config()
cert_pwd = conf.GetCertPwdMustExist()
obj_dir = "obj-rel"
if target_platform == "X64":
obj_dir += "64"
if not testing and not build_test_installer and not build_rel_installer:
shutil.rmtree(obj_dir, ignore_errors=True)
shutil.rmtree(os.path.join("mupdf", "generated"), ignore_errors=True)
config = "CFG=rel"
if build_test_installer and not build_prerelease:
obj_dir = "obj-dbg"
config = "CFG=dbg"
extcflags = ""
if build_prerelease:
extcflags = "EXTCFLAGS=-DSVN_PRE_RELEASE_VER=%s" % ver
platform = "PLATFORM=%s" % (target_platform or "X86")
run_cmd_throw("nmake", "-f", "makefile.msvc", config, extcflags, platform, "all_sumatrapdf")
exe = os.path.join(obj_dir, "SumatraPDF.exe")
if upload:
sign(exe, cert_pwd)
sign(os.path.join(obj_dir, "uninstall.exe"), cert_pwd)
build_installer_data(obj_dir)
run_cmd_throw("nmake", "-f", "makefile.msvc", "Installer", config, platform, extcflags)
if build_test_installer or build_rel_installer:
sys.exit(0)
installer = os.path.join(obj_dir, "Installer.exe")
if upload:
sign(installer, cert_pwd)
pdb_zip = os.path.join(obj_dir, "%s.pdb.zip" % filename_base)
#.........这里部分代码省略.........
示例8: build
def build(upload, upload_tmp, testing, build_test_installer, build_rel_installer, build_prerelease, skip_transl_update, svn_revision, target_platform):
verify_started_in_right_directory()
try_find_config_files()
if build_prerelease:
if svn_revision is None:
run_cmd_throw("svn", "update")
(out, err) = run_cmd_throw("svn", "info")
ver = str(parse_svninfo_out(out))
else:
# allow to pass in an SVN revision, in case SVN itself isn't
# available
ver = svn_revision
else:
ver = extract_sumatra_version(os.path.join("src", "Version.h"))
if upload:
verify_correct_branch(ver)
verify_not_tagged_yet(ver)
log("Version: '%s'" % ver)
# don't update translations for release versions to prevent Trunk changes
# from messing up the compilation of a point release on a branch
if build_prerelease and not skip_transl_update:
trans_upload.uploadStringsIfChanged()
changed = trans_download.downloadAndUpdateTranslationsIfChanged()
# Note: this is not a perfect check since re-running the script will
# proceed
if changed:
print(
"\nNew translations have been downloaded from apptranslator.og")
print(
"Please verify and checkin src/Translations_txt.cpp and strings/translations.txt")
sys.exit(1)
filename_base = "SumatraPDF-%s" % ver
if build_prerelease:
filename_base = "SumatraPDF-prerelease-%s" % ver
s3_dir = "sumatrapdf/rel"
if build_prerelease:
s3_dir = "sumatrapdf/prerel"
if upload_tmp:
upload = True
s3_dir += "tmp"
if upload:
log("Will upload to s3 at %s" % s3_dir)
conf = load_config()
s3.set_secrets(conf.aws_access, conf.aws_secret)
s3.set_bucket("kjkpub")
s3_prefix = "%s/%s" % (s3_dir, filename_base)
s3_exe = s3_prefix + ".exe"
s3_installer = s3_prefix + "-install.exe"
s3_pdb_lzsa = s3_prefix + ".pdb.lzsa"
s3_pdb_zip = s3_prefix + ".pdb.zip"
s3_exe_zip = s3_prefix + ".zip"
s3_files = [s3_exe, s3_installer, s3_pdb_lzsa, s3_pdb_zip]
if not build_prerelease:
s3_files.append(s3_exe_zip)
cert_pwd = None
cert_path = os.path.join("scripts", "cert.pfx")
if upload:
map(s3.verify_doesnt_exist, s3_files)
verify_path_exists(cert_path)
conf = load_config()
cert_pwd = conf.GetCertPwdMustExist()
obj_dir = "obj-rel"
if target_platform == "X64":
obj_dir += "64"
if not testing and not build_test_installer and not build_rel_installer:
shutil.rmtree(obj_dir, ignore_errors=True)
shutil.rmtree(os.path.join("mupdf", "generated"), ignore_errors=True)
config = "CFG=rel"
if build_test_installer and not build_prerelease:
obj_dir = "obj-dbg"
config = "CFG=dbg"
extcflags = ""
if build_prerelease:
extcflags = "EXTCFLAGS=-DSVN_PRE_RELEASE_VER=%s" % ver
platform = "PLATFORM=%s" % (target_platform or "X86")
# build executables for signing (building the installer will build the rest)
(out, err) = run_cmd_throw("nmake", "-f", "makefile.msvc",
config, extcflags, platform,
"SumatraPDF", "Uninstaller")
if build_test_installer:
print_run_resp(out, err)
exe = os.path.join(obj_dir, "SumatraPDF.exe")
sign_retry(exe, cert_pwd)
sign_retry(os.path.join(obj_dir, "SumatraPDF-no-MuPDF.exe"), cert_pwd)
sign_retry(os.path.join(obj_dir, "uninstall.exe"), cert_pwd)
#.........这里部分代码省略.........
示例9: settings_src_dir
def settings_src_dir():
return util.verify_path_exists(g_script_dir)
示例10: src_dir
def src_dir():
p = os.path.join(script_dir(), "..", "src")
return util.verify_path_exists(p)
示例11: src_dir
def src_dir():
d = os.path.dirname(__file__)
p = os.path.join(d, "..", "src")
return util.verify_path_exists(p)