MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / __init__

Method __init__

web/pgadmin/utils/csv_lib.py:218–238  ·  view source on GitHub ↗
(self, fileobj, dialect='excel', **fmtparams)

Source from the content-addressed store, hash-verified

216
217class Writer():
218 def __init__(self, fileobj, dialect='excel', **fmtparams):
219 if fileobj is None:
220 raise TypeError('fileobj must be file-like, not None')
221
222 self.fileobj = fileobj
223
224 if isinstance(dialect, str):
225 dialect = get_dialect(dialect)
226
227 try:
228 self.dialect = Dialect.combine(dialect, fmtparams)
229 except Error as e:
230 raise TypeError(*e.args)
231
232 strategies = {
233 QUOTE_MINIMAL: QuoteMinimalStrategy,
234 QUOTE_ALL: QuoteAllStrategy,
235 QUOTE_NONNUMERIC: QuoteNonnumericStrategy,
236 QUOTE_NONE: QuoteNoneStrategy,
237 }
238 self.strategy = strategies[self.dialect.quoting](self.dialect)
239
240 def writerow(self, row):
241 if row is None:

Callers

nothing calls this directly

Calls 2

get_dialectFunction · 0.85
combineMethod · 0.80

Tested by

no test coverage detected