def expand (self, db_schema, inc_tags=False, exc_tags=False,
out_pth=_TEMPLATE_PTH):
self.db_schema = db_schema
self.inc_tags, self.exc_tags = inc_tags, exc_tags
assert not (inc_tags and exc_tags), "cannot have included and excluded tags"
with open (out_pth, 'w') as out_hndl:
self.out_hndl = out_hndl
self.csv_writer = csv.DictWriter (out_hndl,
fieldnames=[x.value for x in consts.OUTPUT_COLS],
extrasaction='ignore',
quoting=csv.QUOTE_ALL,
)
self.csv_writer.writeheader()
for f in self.db_schema:
self.expand_form (f)
评论列表
文章目录