本文整理汇总了Python中util2.chdir_top函数的典型用法代码示例。如果您正苦于以下问题:Python chdir_top函数的具体用法?Python chdir_top怎么用?Python chdir_top使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了chdir_top函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: main
def main():
util2.chdir_top()
structDef = BuildStruct(GlobalPrefs)
structMetadata = BuildMetaData(GlobalPrefs)
content = SettingsStructs_Header % locals()
open("src/SettingsStructs.h", "wb").write(content.replace("\n", "\r\n").replace("\t", " "))
content = AssembleDefaults(GlobalPrefs,
"You can use this file to modify experimental and expert settings not changeable " +
"through the UI instead of modifying SumatraPDF-settings.txt directly. Just copy " +
"this file alongside SumatraPDF-settings.txt and change the values below. " +
"They will overwrite the corresponding settings in SumatraPDF-settings.txt at every startup.")
content = "# Warning: This file only works for builds compiled with ENABLE_SUMATRAPDF_USER_INI !\n\n" + content
open("docs/SumatraPDF-user.ini", "wb").write(content.replace("\n", "\r\n").encode("utf-8-sig"))
beforeUseDefaultState = True
for field in FileSettings:
if field.name == "UseDefaultState":
beforeUseDefaultState = False
elif beforeUseDefaultState:
assert field.name not in rememberedDisplayState, "%s shouldn't be serialized when UseDefaultState is true" % field.name
else:
assert field.name in rememberedDisplayState or field.internal, "%s won't be serialized when UseDefaultState is true" % field.name
开发者ID:eminemence,项目名称:advancedoptionsui-sumatrapdf,代码行数:25,代码来源:gen_settingsstructs.py
示例2: main
def main():
util2.chdir_top()
tags = [(name, getEnumName(name, "Tag")) for name in sorted(List_HTML_Tags.split() + List_Other_Tags.split())]
attrs = [(name, getEnumName(name, "Attr")) for name in sorted(List_HTML_Attrs.split() + List_Other_Attrs.split())]
aligns = [(name, getEnumName(name, "Align")) for name in sorted(List_Align_Values.split())]
cssProps = [(name, getEnumName(name, "Css")) for name in sorted(List_CSS_Props.split() + List_SMX_Props.split())]
cssColors = [(name, "MKRGB(%s)" % value) for (name, value) in sorted(List_CSS_Colors)]
enum_htmltag = createTypeEnum(tags, "HtmlTag", "Tag_NotFound")
enum_htmlattr = createTypeEnum(attrs, "HtmlAttr", "Attr_NotFound")
enum_alignattr = createTypeEnum(aligns, "AlignAttr", "Align_NotFound")
enum_cssprop = createTypeEnum(cssProps, "CssProp", "Css_Unknown")
code_defines = Template_Defines
code_htmltag = createFastFinder(tags, "HtmlTag", "Tag_NotFound", True)
code_htmlattr = createFastFinder(attrs, "HtmlAttr", "Attr_NotFound", True)
code_selfclosing = createFastSelector(tags, List_Self_Closing_Tags.split(), "IsTagSelfClosing", "HtmlTag")
code_inlinetag = createFastSelector(tags, List_Inline_Tags.split(), "IsInlineTag", "HtmlTag")
code_alignattr = createFastFinder(aligns, "AlignAttr", "Align_NotFound", True)
code_htmlentity = (
Template_Entities_Comment
+ "\n"
+ createFastFinder(List_HTML_Entities, "uint32_t", "-1", False, "HtmlEntityRune")
)
code_cssprop = createFastFinder(cssProps, "CssProp", "Css_Unknown", True)
code_csscolor = createFastFinder(cssColors, "ARGB", "MKRGBA(0,0,0,0)", True, "CssColor")
content = Template_Lookup_Header % locals()
open("src/utils/HtmlParserLookup.h", "wb").write(content.replace("\n", "\r\n"))
content = Template_Lookup_Code[:-1] % locals()
open("src/utils/HtmlParserLookup.cpp", "wb").write(content.replace("\n", "\r\n"))
开发者ID:kindleStudy,项目名称:sumatrapdf,代码行数:32,代码来源:gen_htmlparserlookup.py
示例3: main
def main():
util2.chdir_top()
vcproj = open(VC2008_PROJ, "rb").read().replace("\r\n", "\n")
fileNodes = parseNodes(getFilesNode(vcproj))
addedPaths = findAddedFiles(extractPaths(fileNodes))
vcprojNew = updateProj(vcproj, fileNodes, addedPaths)
if vcprojNew != vcproj:
open(VC2008_PROJ, "wb").write(vcprojNew.replace("\n", "\r\n"))
开发者ID:BianChengNan,项目名称:sumatrapdf,代码行数:10,代码来源:update_vs2008.py
示例4: main
def main():
util2.chdir_top()
os.chdir("mupdf")
fitz_exports = generateExports("fitz/fitz.h", ["fz_init_ui_pointer_event", "fz_access_submit_event"]) + "\n\n" + generateExports("fitz/fitz-internal.h", ["fz_assert_lock_held", "fz_assert_lock_not_held", "fz_lock_debug_lock", "fz_lock_debug_unlock", "fz_purge_glyph_cache"])
mupdf_exports = generateExports("pdf/mupdf.h") + "\n\n" + generateExports("pdf/mupdf-internal.h", ["pdf_crypt_buffer", "pdf_open_compressed_stream"])
muxps_exports = generateExports("xps/muxps.h") + "\n\n" + generateExports("xps/muxps-internal.h", ["xps_parse_solid_color_brush", "xps_print_path"])
mucbz_exports = generateExports("cbz/mucbz.h")
list = LIBMUPDF_DEF % locals()
open("../src/libmupdf.def", "wb").write(list.replace("\n", "\r\n"))
开发者ID:Jshauk,项目名称:sumatrapdf,代码行数:11,代码来源:gen_libmupdf.def.py
示例5: main
def main():
util2.chdir_top()
groups = {}
for file in trans_gen.C_FILES_TO_PROCESS:
groups.update(extract_accesskey_groups(file))
translations = open(trans_download.lastDownloadFilePath(), "rb").read()
translations = trans_download.parseTranslations(translations)
detect_accesskey_clashes(groups, translations)
开发者ID:Andy-Amoy,项目名称:sumatrapdf,代码行数:11,代码来源:check_accesskeys.py
示例6: main
def main():
util2.chdir_top()
files = build_files(g_filters, pj(top_dir(), "vs"))
vcxproj_part = gen_vcxproj_part(files)
file_path = os.path.join("vs", "sumatrapdf-vc2013.vcxproj")
replace_item_group(file_path, file_path, vcxproj_part)
filters_part = gen_vcxproj_filters_part(g_filters, files)
file_path = os.path.join("vs", "sumatrapdf-vc2013.vcxproj.filters")
replace_item_group(file_path, file_path, filters_part)
开发者ID:noname007,项目名称:sumatrapdf,代码行数:12,代码来源:update_vs.py
示例7: main
def main():
util2.chdir_top()
appStructDef = BuildStruct(GlobalPrefs)
appStructMetadata = BuildMetaData(GlobalPrefs)
userStructDef = BuildStruct(UserPrefs)
userStructMetadata = BuildMetaData(UserPrefs)
content = AppPrefs3_Header % locals()
open("tools/serini_test/AppPrefs3.h", "wb").write(content.replace("\n", "\r\n").replace("\t", " "))
content = AssembleDefaults(UserPrefs)
open("tools/serini_test/SumatraPDF-user.ini", "wb").write(content.replace("\n", "\r\n"))
开发者ID:kindleStudy,项目名称:sumatrapdf,代码行数:13,代码来源:gen_appprefs3.py
示例8: main
def main():
util2.chdir_top()
os.chdir("mupdf")
# don't include/export doc_* functions, support for additional input/output formats and form support
doc_exports = collectFunctions("source/fitz/document.c") + ["fz_get_annot_type"]
more_formats = collectFunctions("source/fitz/svg-device.c") + collectFunctions("source/fitz/output-pcl.c") + collectFunctions("source/fitz/output-pwg.c")
form_exports = collectFunctions("source/pdf/pdf-form.c") + collectFunctions("source/pdf/pdf-event.c") + ["pdf_access_submit_event", "pdf_init_ui_pointer_event"]
fitz_exports = generateExports("include/mupdf/fitz", doc_exports + more_formats)
mupdf_exports = generateExports("include/mupdf/pdf", form_exports + ["pdf_crypt_buffer", "pdf_open_compressed_stream"])
muxps_exports = generateExports("include/mupdf/xps.h", ["xps_parse_solid_color_brush", "xps_print_path"])
list = LIBMUPDF_DEF % locals()
open("../src/libmupdf.def", "wb").write(list.replace("\n", "\r\n"))
开发者ID:niife,项目名称:sumatrapdf,代码行数:15,代码来源:gen_libmupdf.def.py
示例9: main
def main():
util2.chdir_top()
os.chdir("mupdf")
# don't include/export doc_* functions, mucbz.h and muimage.h functions and svg and pwg functions
doc_exports = collectFunctions("fitz/doc_document.c") + collectFunctions("fitz/doc_interactive.c")
more_formats = collectFunctions("fitz/dev_svg.c") + collectFunctions("fitz/res_pwg.c")
ignore_exports = doc_exports + more_formats + ["fz_init_ui_pointer_event", "fz_access_submit_event"]
fitz_exports = generateExports("fitz/fitz.h", ignore_exports) + "\n\n" + generateExports("fitz/fitz-internal.h", ignore_exports)
mupdf_exports = generateExports("pdf/mupdf.h") + "\n\n" + generateExports("pdf/mupdf-internal.h", ["pdf_crypt_buffer", "pdf_open_compressed_stream"])
muxps_exports = generateExports("xps/muxps.h") + "\n\n" + generateExports("xps/muxps-internal.h", ["xps_parse_solid_color_brush", "xps_print_path"])
list = LIBMUPDF_DEF % locals()
open("../src/libmupdf.def", "wb").write(list.replace("\n", "\r\n"))
开发者ID:DavidWiberg,项目名称:sumatrapdf,代码行数:15,代码来源:gen_libmupdf.def.py
示例10: main
def main():
util2.chdir_top()
structDef = BuildStruct(GlobalPrefs)
structMetadata = BuildMetaData(GlobalPrefs)
content = SettingsStructs_Header % locals()
open("src/SettingsStructs.h", "wb").write(content.replace("\n", "\r\n").replace("\t", " "))
content = AssembleDefaults(GlobalPrefs,
"You can use this file to modify experimental and expert settings not changeable " +
"through the UI instead of modifying SumatraPDF-settings.txt directly. Just copy " +
"this file alongside SumatraPDF-settings.txt and change the values below. " +
"They will overwrite the corresponding settings in SumatraPDF-settings.txt at every startup.")
content = "# Warning: This file only works for builds compiled with ENABLE_SUMATRAPDF_USER_INI !\n\n" + content
open("docs/SumatraPDF-user.ini", "wb").write(content.replace("\n", "\r\n").encode("utf-8-sig"))
开发者ID:fengxueysf,项目名称:sumatrapdf,代码行数:16,代码来源:gen_settingsstructs.py
示例11: main
def main():
util2.chdir_top()
structDef = BuildStruct(GlobalPrefs)
structMetadata = BuildMetaData(GlobalPrefs)
content = SettingsStructs_Header % locals()
open("src/SettingsStructs.h", "wb").write(content.replace("\n", "\r\n").replace("\t", " "))
# content = AssembleDefaultsSqt(UserPrefs,
content = AssembleDefaults(UserPrefs,
"You can use this file to modify settings not changeable through the UI " +
"instead of modifying SumatraPDF.dat directly. Just copy this file alongside " +
"SumatraPDF.dat and change the values below. They will overwrite the corresponding " +
"settings in SumatraPDF.dat at every startup.")
content = "# Caution: All settings below are still subject to change!\n\n" + content
open("docs/SumatraPDF-user.ini", "wb").write(content.replace("\n", "\r\n").encode("utf-8-sig"))
开发者ID:Jshauk,项目名称:sumatrapdf,代码行数:17,代码来源:gen_settingsstructs.py
示例12: main
def main():
util2.chdir_top()
os.chdir("mupdf")
# don't include/export doc_* functions, support for additional input/output formats and form support
doc_exports = collectFunctions("source/fitz/document.c") + collectFunctions("source/fitz/document-all.c") + collectFunctions("source/fitz/document-no-run.c") + ["fz_get_annot_type"]
more_formats = collectFunctions("source/fitz/svg-device.c") + collectFunctions("source/fitz/output-pcl.c") + collectFunctions("source/fitz/output-pwg.c")
form_exports = collectFunctions("source/pdf/pdf-form.c") + collectFunctions("source/pdf/pdf-event.c") + collectFunctions("source/pdf/pdf-appearance.c") + collectFunctions("source/pdf/js/pdf-jsimp-cpp.c") + ["pdf_access_submit_event", "pdf_init_ui_pointer_event"]
misc_exports = collectFunctions("source/fitz/stream-prog.c") + collectFunctions("source/fitz/test-device.c")
sign_exports = ["pdf_crypt_buffer", "pdf_read_pfx", "pdf_sign_signature", "pdf_signer_designated_name", "pdf_free_designated_name"]
fitz_exports = generateExports("include/mupdf/fitz", doc_exports + more_formats + misc_exports)
mupdf_exports = generateExports("include/mupdf/pdf", form_exports + sign_exports + ["pdf_open_compressed_stream"])
muxps_exports = generateExports("include/mupdf/xps.h", ["xps_parse_solid_color_brush", "xps_print_path"])
unarr_exports = generateExports("../ext/unarr/unarr.h")
list = LIBMUPDF_DEF % locals()
open("../src/libmupdf.def", "wb").write(list.replace("\n", "\r\n"))
开发者ID:Andy-Amoy,项目名称:sumatrapdf,代码行数:18,代码来源:gen_libmupdf.def.py
示例13: main
def main():
util2.chdir_top()
structDef = BuildStruct(GlobalPrefs)
structMetadata = BuildMetaData(GlobalPrefs)
content = SettingsStructs_Header % locals()
open("src/SettingsStructs.h", "wb").write(content.replace("\n", "\r\n").replace("\t", " "))
content = GenerateSettingsHtml()
open("docs/settings.html", "wb").write(content.replace("\n", "\r\n"))
beforeUseDefaultState = True
for field in FileSettings:
if field.name == "UseDefaultState":
beforeUseDefaultState = False
elif beforeUseDefaultState:
assert field.name not in rememberedDisplayState, "%s shouldn't be serialized when UseDefaultState is true" % field.name
else:
assert field.name in rememberedDisplayState or field.internal, "%s won't be serialized when UseDefaultState is true" % field.name
开发者ID:BianChengNan,项目名称:sumatrapdf,代码行数:20,代码来源:gen_settingsstructs.py
示例14: open
file_name = "langs.html"
p = os.path.join("scripts", file_name)
open(p, "w").write(s)
if blog_dir():
p = os.path.join(blog_dir(), file_name)
open(p, "w").write(s)
def gen_html():
prefs = gen_settingsstructs.GlobalPrefs
inside = gen_struct(prefs)
s = html_tmpl.replace("%INSIDE%", inside)
file_name = "settings" + g_version + ".html"
p = os.path.join("scripts", file_name)
open(p, "w").write(s)
if blog_dir():
p = os.path.join(blog_dir(), file_name)
open(p, "w").write(s)
# also save the latest version as settings.html so that there is a
# permament version we can link from from docs that is independent of
# program version number
p = os.path.join(blog_dir(), "settings.html")
open(p, "w").write(s)
if __name__ == "__main__":
util2.chdir_top()
gen_langs_html()
gen_html()
gen_settingsstructs.main()
开发者ID:josgraha,项目名称:sumatrapdf,代码行数:30,代码来源:gen_settings_html.py
示例15: main
def main():
util2.chdir_top()
injectDependencyList(flattenDependencyList(createDependencyList()))
开发者ID:BianChengNan,项目名称:sumatrapdf,代码行数:3,代码来源:update_dependencies.py
注:本文中的util2.chdir_top函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论