• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python util.run_cmd_throw函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中util.run_cmd_throw函数的典型用法代码示例。如果您正苦于以下问题:Python run_cmd_throw函数的具体用法?Python run_cmd_throw怎么用?Python run_cmd_throw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了run_cmd_throw函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: build_efi_result

def build_efi_result(ver):
    path = efi_result_file(ver)
    if os.path.exists(path):
        return  # was already done
    os.chdir(sum_efi_cache_dir(ver))
    util.run_cmd_throw("efi", "SumatraPDF.exe", ">efi.txt")
    util.bz_file_compress("efi.txt", "efi.txt.bz2")
开发者ID:BianChengNan,项目名称:sumatrapdf,代码行数:7,代码来源:efi_cmp.py


示例2: 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)
开发者ID:Nargesf,项目名称:Sumatrapdf,代码行数:28,代码来源:build.py


示例3: 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)
开发者ID:Jshauk,项目名称:sumatrapdf,代码行数:25,代码来源:buildbot-fix.py


示例4: main

def main():
    if len(sys.argv) < 2:
        usage_and_exit()
    #print("top_dir: '%s'" % get_top_dir())
    ensure_7z_exists()
    conf = util.load_config()
    cert_pwd = conf.GetCertPwdMustExist()
    s3.set_secrets(conf.aws_access, conf.aws_secret)
    s3.set_bucket("kjkpub")

    ver = sys.argv[1]
    #print("ver: '%s'" % ver)
    svn_url = "https://sumatrapdf.googlecode.com/svn/tags/%srel" % ver
    src_dir_name = "SumatraPDF-%s-src" % ver
    archive_name = src_dir_name + ".7z"
    s3_path = "sumatrapdf/rel/" + archive_name
    print("svn_url: '%s'\ndir_name: '%s'\narchive_name: %s\ns3_path: %s" % (svn_url, src_dir_name, archive_name, s3_path))
    s3.verify_doesnt_exist(s3_path)

    os.chdir(get_top_dir())
    util.run_cmd_throw("svn", "export", svn_url, src_dir_name)
    util.run_cmd_throw("7z", "a", "-r", archive_name, src_dir_name)
    s3.upload_file_public(archive_name, s3_path)
    shutil.rmtree(src_dir_name)
    os.remove(archive_name)
开发者ID:tin-pot,项目名称:sumatrapdf,代码行数:25,代码来源:upload_sources.py


示例5: build_release

def build_release(stats, ver):
	config = "CFG=rel"
	obj_dir = "obj-rel"
	extcflags = "EXTCFLAGS=-DSVN_PRE_RELEASE_VER=%s" % ver
	platform = "PLATFORM=X86"

	shutil.rmtree(obj_dir, ignore_errors=True)
	shutil.rmtree(os.path.join("mupdf", "generated"), ignore_errors=True)
	(out, err, errcode) = run_cmd("nmake", "-f", "makefile.msvc", config, extcflags, platform, "all_sumatrapdf")

	log_path = os.path.join(get_logs_cache_dir(), ver + "_rel_log.txt")
	build_log = out + "\n====STDERR:\n" + err
	build_log = strip_empty_lines(build_log)
	open(log_path, "w").write(build_log)

	stats.rel_build_log = ""
	stats.rel_failed = False
	if errcode != 0:
		stats.rel_build_log = build_log
		stats.rel_failed = True
		return

	stats.rel_sumatrapdf_exe_size = file_size_in_obj("SumatraPDF.exe")
	stats.rel_sumatrapdf_no_mupdf_exe_size = file_size_in_obj("SumatraPDF-no-MuPDF.exe")
	stats.rel_libmupdf_dll_size = file_size_in_obj("libmupdf.dll")
	stats.rel_nppdfviewer_dll_size = file_size_in_obj("npPdfViewer.dll")
	stats.rel_pdffilter_dll_size = file_size_in_obj("PdfFilter.dll")
	stats.rel_pdfpreview_dll_size = file_size_in_obj("PdfPreview.dll")

	build_installer_data(obj_dir)
	run_cmd_throw("nmake", "-f", "makefile.msvc", "Installer", config, platform, extcflags)
	p = os.path.join(obj_dir, "Installer.exe")
	stats.rel_installer_exe_size = file_size(p)
开发者ID:Jshauk,项目名称:sumatrapdf,代码行数:33,代码来源:buildbot.py


示例6: verify_flint_installed

def verify_flint_installed():
    try:
        util.run_cmd_throw("flint")
    except:
        print("flint doesn't seem to be installed")
        print("https://github.com/facebook/flint")
        sys.exit(1)
开发者ID:noname007,项目名称:sumatrapdf,代码行数:7,代码来源:runflint.py


示例7: build_win

def build_win():
	util.run_cmd_throw("premake4", "vs2010")
	curr_dir = os.getcwd()
	os.chdir("vs-premake")
	util.kill_msbuild()
	util.run_cmd_throw("devenv", "ag.sln", "/Build", "Release", "/Project", "ag.vcxproj")
	assert os.path.exists(ag_exe_path_win()), "%s doesn't exist" % ag_exe_path_win()
	os.chdir(curr_dir)
开发者ID:kjk,项目名称:the_silver_searcher,代码行数:8,代码来源:runtests.py


示例8: create_pdb_lzsa_archive

def create_pdb_lzsa_archive(dir, archive_name):
    archive_path = os.path.join(dir, archive_name)
    MakeLzsa = os.path.join(dir, "MakeLzsa.exe")
    files = ["libmupdf.pdb", "Installer.pdb",
             "SumatraPDF-no-MuPDF.pdb", "SumatraPDF.pdb"]
    files = [os.path.join(dir, file) + ":" + file for file in files]
    run_cmd_throw(MakeLzsa, archive_path, *files)
    return archive_path
开发者ID:Nargesf,项目名称:Sumatrapdf,代码行数:8,代码来源:build.py


示例9: build

def build():
	util.run_cmd_throw("premake4", "vs2010")
	os.chdir("build")
	util.kill_msbuild()
	util.run_cmd_throw("devenv", "pigz.sln", "/Build", "Release", "/Project", "pigz.vcxproj")
	os.chdir(os.path.join("..", "rel"))
	assert os.path.exists("pigz.exe")
	# yes, those are the same files, the binary decides what it is based on its name
	shutil.copyfile("pigz.exe", "unpigz.exe")
开发者ID:andschenk,项目名称:pigz,代码行数:9,代码来源:build.py


示例10: build_and_upload_efi_out

def build_and_upload_efi_out(ver):
	obj_dir = "obj-rel"
	s3dir = "sumatrapdf/buildbot/%s/" % ver
	os.chdir(obj_dir)
	util.run_cmd_throw("efi", "SumatraPDF.exe", ">efi.txt")
	util.bz_file_compress("efi.txt", "efi.txt.bz2")
	s3.upload_file_public("efi.txt.bz2", s3dir + "efi.txt.bz2", silent=True)
	shutil.copyfile("efi.txt.bz2", logs_efi_out_path(ver))
	os.chdir("..")
开发者ID:Jshauk,项目名称:sumatrapdf,代码行数:9,代码来源:buildbot.py


示例11: run_tests

def run_tests(build_dir):
  total = len(test_exes)
  curr = 1
  for f in test_exes:
    p = os.path.join(build_dir, f)
    print("Running test %d/%d %s" % (curr, total, p))
    out, err = run_cmd_throw(p)
    print(out + err)
    curr += 1

  p = os.path.join(build_dir, dbbench_exe)
  print("Running %s" % p)
  run_cmd_throw(p)
开发者ID:LazyCodingCat,项目名称:LevelDB,代码行数:13,代码来源:build.py


示例12: sign

def sign(file_path, cert_pwd):
  # the sign tool is finicky, so copy it and cert to the same dir as
  # exe we're signing
  file_dir = os.path.dirname(file_path)
  file_name = os.path.basename(file_path)
  cert_src = os.path.join("scripts", "cert.pfx")
  cert_dest = os.path.join(file_dir, "cert.pfx")
  if not os.path.exists(cert_dest): shutil.copy(cert_src, cert_dest)
  curr_dir = os.getcwd()
  os.chdir(file_dir)
  run_cmd_throw("signtool.exe", "sign", "/t", "http://timestamp.verisign.com/scripts/timstamp.dll",
 "/du", "http://blog.kowalczyk.info/software/sumatrapdf/", "/f", "cert.pfx", "/p", cert_pwd, file_name)
  os.chdir(curr_dir)
开发者ID:aarjones55,项目名称:sumatrapdf,代码行数:13,代码来源:build-release.py


示例13: upload

def upload(ver):
    svn_url = "https://sumatrapdf.googlecode.com/svn/tags/%srel" % ver
    src_dir_name = "SumatraPDF-%s-src" % ver
    archive_name = src_dir_name + ".7z"
    s3_path = "sumatrapdf/rel/" + archive_name
    print("svn_url: '%s'\ndir_name: '%s'\narchive_name: %s\ns3_path: %s" % (svn_url, src_dir_name, archive_name, s3_path))
    s3.verify_doesnt_exist(s3_path)

    os.chdir(get_top_dir())
    util.run_cmd_throw("svn", "export", svn_url, src_dir_name)
    util.run_cmd_throw("7z", "a", "-r", archive_name, src_dir_name)
    s3.upload_file_public(archive_name, s3_path)
    shutil.rmtree(src_dir_name)
    os.remove(archive_name)
开发者ID:kepazon,项目名称:my_sumatrapdf,代码行数:14,代码来源:upload_sources.py


示例14: build_ver

def build_ver(ver):
    print("Building release version %d" % ver)
    obj_dir = "obj-rel"

    if already_built(ver):
        print("Version %d already built!" % ver)
        return
    os.chdir(sum_efi_dir())
    util.run_cmd_throw("svn", "update", "-r%d" % ver)
    build_clean(ver)

    for f in g_build_artifacts:
        src = os.path.join(obj_dir, f)
        dst = os.path.join(sum_efi_cache_dir(ver), f)
        shutil.copyfile(src, dst)
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:15,代码来源:efi_cmp.py


示例15: build_ver

def build_ver(ver):
	print("Building release version %d" % ver)
	config = "CFG=rel"
	obj_dir = "obj-rel"
	extcflags = "EXTCFLAGS=-DSVN_PRE_RELEASE_VER=%s" % ver
	platform = "PLATFORM=X86"

	if already_built(ver):
		print("Version %d already built!" % ver)
		return
	os.chdir(sum_efi_dir())
	util.run_cmd_throw("svn", "update", "-r%d" % ver)

	shutil.rmtree(obj_dir, ignore_errors=True)
	shutil.rmtree(os.path.join("mupdf", "generated"), ignore_errors=True)
	(out, err, errcode) = util.run_cmd("nmake", "-f", "makefile.msvc", config, extcflags, platform, "all_sumatrapdf")
	for f in g_build_artifacts:
		src = os.path.join(obj_dir, f)
		dst = os.path.join(sum_efi_cache_dir(ver), f)
		shutil.copyfile(src, dst)
开发者ID:kindleStudy,项目名称:sumatrapdf,代码行数:20,代码来源:efi_cmp.py


示例16: test_one_with_flag2

def test_one_with_flag2(sha1_orig, suffix, flag1, flag2):
	pigz_exe = os.path.join("..", "rel", "pigz.exe")
	unpigz_exe = os.path.join("..", "rel", "unpigz.exe")
	util.run_cmd_throw(pigz_exe, flag1, flag2, "pigz.c")
	util.run_cmd_throw(pigz_exe, "-t", "pigz.c" + suffix)
	util.run_cmd_throw(unpigz_exe, "pigz.c" + suffix)
	assert sha1_orig == util.file_sha1("pigz.c")
开发者ID:andschenk,项目名称:pigz,代码行数:7,代码来源:build.py


示例17: checkin_comment_for_ver

def checkin_comment_for_ver(ver):
	global g_svn_log_per_ver
	ver = str(ver)
	if g_svn_log_per_ver is None:
		g_svn_log_per_ver = load_svn_log_data()
	if ver not in g_svn_log_per_ver:
		# TODO: retry few times to make it robust against temporary network failures
		(out, err) = run_cmd_throw("svn", "log", "-r%s" % ver, "-v")
		g_svn_log_per_ver[ver] = out
		save_svn_log_data(g_svn_log_per_ver)
	s = g_svn_log_per_ver[ver]
	res = parse_svnlog_out(s)
	if res is None:
		return "not a source code change"
	return res[1]
开发者ID:Jshauk,项目名称:sumatrapdf,代码行数:15,代码来源:buildbot.py


示例18: 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)

#.........这里部分代码省略.........
开发者ID:aarjones55,项目名称:sumatrapdf,代码行数:101,代码来源:build-release.py


示例19: get_url_ver

def get_url_ver():
    raise BaseException("NYI for git")
    (out, err) = util.run_cmd_throw("svn", "info")
    return extract_url_ver_from_svn_out(out)
开发者ID:kepazon,项目名称:my_sumatrapdf,代码行数:4,代码来源:upload_sources.py


示例20: build_efi_result_current

def build_efi_result_current():
    os.chdir("obj-rel")
    util.run_cmd_throw("efi", "SumatraPDF.exe", ">efi.txt")
    util.bz_file_compress("efi.txt", "efi.txt.bz2")
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:4,代码来源:efi_cmp.py



注:本文中的util.run_cmd_throw函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.run_command函数代码示例发布时间:2022-05-26
下一篇:
Python util.run_cmd函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap