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

Method combine

web/pgadmin/utils/csv_lib.py:602–616  ·  view source on GitHub ↗

Create a new dialect with defaults and added parameters.

(cls, dialect, fmtparams)

Source from the content-addressed store, hash-verified

600
601 @classmethod
602 def combine(cls, dialect, fmtparams):
603 """Create a new dialect with defaults and added parameters."""
604 dialect = cls.extend(dialect, fmtparams)
605 defaults = cls.defaults()
606 specified = dict(
607 (attr, getattr(dialect, attr, None))
608 for attr in defaults
609 if getattr(dialect, attr, None) is not None or
610 attr in ['quotechar', 'delimiter', 'lineterminator', 'quoting']
611 )
612
613 defaults.update(specified)
614 dialect = type(str('CombinedDialect'), (cls,), defaults)
615 cls.validate(dialect)
616 return dialect()
617
618 def __delattr__(self, attr):
619 if self._valid:

Callers 2

__init__Method · 0.80
__init__Method · 0.80

Calls 4

extendMethod · 0.80
defaultsMethod · 0.45
updateMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected