templated_workbook.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:openpyxl-templates 作者: SverkerSbrg 项目源码 文件源码
def __init__(self, file=None, template_styles=None, timestamp=None, templated_sheets=None):
        super().__init__()

        self.workbook = load_workbook(filename=file) if file else Workbook()

        self.template_styles = template_styles or DefaultStyleSet()
        self.timestamp = timestamp

        self.templated_sheets = []
        for sheetname, templated_sheet in self._items.items():
            self.add_templated_sheet(templated_sheet, sheetname=sheetname, add_to_self=False)

        for templated_sheet in templated_sheets or []:
            self.add_templated_sheet(sheet=templated_sheet, sheetname=templated_sheet.sheetname, add_to_self=True)

        self._validate()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号