本文整理匯總了Python中book.Book.ragged_rows方法的典型用法代碼示例。如果您正苦於以下問題:Python Book.ragged_rows方法的具體用法?Python Book.ragged_rows怎麽用?Python Book.ragged_rows使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類book.Book
的用法示例。
在下文中一共展示了Book.ragged_rows方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: open_workbook_2007_xml
# 需要導入模塊: from book import Book [as 別名]
# 或者: from book.Book import ragged_rows [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