MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / __init__

Method __init__

web/pgadmin/utils/csv_lib.py:716–724  ·  view source on GitHub ↗
(self, f, fieldnames, *args, **kwds)

Source from the content-addressed store, hash-verified

714
715class DictWriter():
716 def __init__(self, f, fieldnames, *args, **kwds):
717 self.fieldnames = fieldnames # list of keys for the dict
718 self.extrasaction = kwds.get('extrasaction', "raise")
719 self.restval = kwds.get('restval', "") # for writing short dicts
720 if self.extrasaction.lower() not in ("raise", "ignore"):
721 raise ValueError("extrasaction (%s) must be 'raise' or 'ignore'"
722 % self.extrasaction)
723 dialect = kwds.get('dialect', "excel")
724 self.writer = Writer(f, dialect, *args, **kwds)
725
726 def writeheader(self):
727 header = dict(zip(self.fieldnames, self.fieldnames))

Callers

nothing calls this directly

Calls 2

WriterClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected