def _printTplMsg(tplFileName): """ 打印模板信息 """ Printer.printNewline() Printer.printBlockHead( None, [Printer.dtext("theme", "tipsTplFile", file=tplFileName)])
def onBeginExportConfig(exportTracer): """ 开始导出一个模板中的其中一个配置 """ # 数据源信息 outInfo = exportTracer.outInfo srcMsgs = [Printer.dtext("export", "tipsSrcData")] for outItemInfo in outInfo.outItemInfos: for text in outItemInfo.dsrcTextList: text = " " + text if text not in srcMsgs: srcMsgs.append(text) # 导出配置信息 dstMsgs = [Printer.dtext("export", "tipsDstFile", file=outInfo.dstFile)] Printer.printNewline() Printer.printBlockHead(Printer.dtext("export", "tipsExporedInfo"), srcMsgs + dstMsgs)
def _printAppMsg(): """ 打印程序信息 """ Printer.printBlockHead( Printer.dtext("theme", "tipsProgramInfo"), [ "program: TableExporter.exe", "version: %s" % engine.VERSION, "author : huangyongwei", "date : 2011/09/20", ], )
def onBeginLoadDataSource(loadTracer): """ 开始加载数据源时被调用 """ Printer.dout("theme", "tipsLoadDataSource", src=loadTracer.getSrcText()) if CustomConfig().query("custom/showProgress", bool): global _cappedPrint _cappedPrint = Printer.capPrinter(True) pbarLen = CustomConfig().query("custom/pbarLen", int) _cappedPrint.pbarLen = pbarLen _cappedPrint.pbarChr = CustomConfig().query("custom/pbarChar") _cappedPrint.fmt = Printer.dtext("theme", "tipsLoadDataSourceProgress", pbarLen=pbarLen)
def onBeginExportConfigItem(exportItemTracer): """ 开始导出一个配置选项时调用 """ global _firstScanData _firstScanData = True exportTracer = exportItemTracer.owner if len(exportTracer.exportItemTracers) > 1: outItemInfo = exportItemTracer.outItemInfo Printer.printBlockHead( None, [ Printer.dtext( "theme", "tipsBeginExportItem", dname=outItemInfo.name) ], width=CustomConfig().query("custom/blockWidth", int) - 10, blockChr="-")