当前位置: 首页>>代码示例>>Python>>正文


Python Book.logfile方法代码示例

本文整理汇总了Python中book.Book.logfile方法的典型用法代码示例。如果您正苦于以下问题:Python Book.logfile方法的具体用法?Python Book.logfile怎么用?Python Book.logfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在book.Book的用法示例。


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

示例1: open_workbook_2007_xml

# 需要导入模块: from book import Book [as 别名]
# 或者: from book.Book import logfile [as 别名]
def open_workbook_2007_xml(
    zf,
    component_names,
    logfile=sys.stdout,
    verbosity=0,
    pickleable=1,
    use_mmap=0,
    formatting_info=0,
    on_demand=0,
    ragged_rows=0,
):
    ensure_elementtree_imported(verbosity, logfile)
    bk = Book()
    bk.logfile = logfile
    bk.verbosity = verbosity
    bk.pickleable = pickleable
    bk.formatting_info = formatting_info
    if formatting_info:
        raise NotImplementedError("formatting_info=True not yet implemented")
    bk.use_mmap = False  #### Not supported initially
    bk.on_demand = on_demand
    if on_demand:
        if verbosity:
            print >> bk.logfile, "WARNING *** on_demand=True not yet implemented; falling back to False"
        bk.on_demand = False
    bk.ragged_rows = ragged_rows

    x12book = X12Book(bk, logfile, verbosity)
    zflo = getzflo(zf, "xl/_rels/workbook.xml.rels")
    x12book.process_rels(zflo)
    del zflo
    zflo = getzflo(zf, "xl/workbook.xml")
    x12book.process_stream(zflo, "Workbook")
    del zflo
    props_name = "docProps/core.xml"
    if props_name in component_names:
        zflo = getzflo(zf, props_name)
        x12book.process_coreprops(zflo)

    x12sty = X12Styles(bk, logfile, verbosity)
    if "xl/styles.xml" in component_names:
        zflo = getzflo(zf, "xl/styles.xml")
        x12sty.process_stream(zflo, "styles")
        del zflo
    else:
        # seen in MS sample file MergedCells.xlsx
        pass

    sst_fname = "xl/sharedStrings.xml"
    x12sst = X12SST(bk, logfile, verbosity)
    if sst_fname in component_names:
        zflo = getzflo(zf, sst_fname)
        x12sst.process_stream(zflo, "SST")
        del zflo

    for sheetx in range(bk.nsheets):
        fname = x12book.sheet_targets[sheetx]
        zflo = getzflo(zf, fname)
        sheet = bk._sheet_list[sheetx]
        x12sheet = X12Sheet(sheet, logfile, verbosity)
        heading = "Sheet %r (sheetx=%d) from %r" % (sheet.name, sheetx, fname)
        x12sheet.process_stream(zflo, heading)
        del zflo
        sheet.tidy_dimensions()

    return bk
开发者ID:parhelia512,项目名称:fdux-slg-game,代码行数:68,代码来源:xlsx.py


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