gavo.rsc.common module¶
Helpers for resource creation.
- exception gavo.rsc.common.DBTableError(msg, qName, hint=None)[source]¶
Bases:
Error
is raised when a manipulation of an on-disk table fails.
It always has a qName attribute containing the qualified name of the table causing the trouble.
- class gavo.rsc.common.FLUSH[source]¶
Bases:
object
A sentinel that grammars can yield to flush out records to the Database.
This probably is only necessary in updating dispatched grammars to enforce dropping of rows dependent on some table.
- class gavo.rsc.common.ParamMixin[source]¶
Bases:
object
A mixin providing param processing.
This is for tables and data elements. If you mix this in, you have to call _initParams(rscdefObject, params=None)
rscdefObject is a TableDef or DataDef, params, if given, a dictionary mapping param names to param values.
- iterParams()[source]¶
iterates over the parameters for this table.
The items returned are rscdef.Param instances.
- class gavo.rsc.common.ParseOptions[source]¶
Bases:
object
see `function getParseOptions`_ .
- change(**kwargs)[source]¶
returns a copy of self with the keyword parameters changed.
Trying to add attributes in this way will raise an AttributeError.
>>> p = parseValidating.change(validateRows=False) >>> p.validateRows False >>> p.change(gulp=1) Traceback (most recent call last): AttributeError: ParseOptions instances have no gulp attributes
- gavo.rsc.common.getParseOptions(validateRows=True, doTableUpdates=False, batchSize=1024, maxRows=None, keepGoing=False, dropIndices=False, dumpRows=False, metaOnly=False, buildDependencies=True, systemImport=False, commitAfterMeta=False, dumpIngestees=False, suppressMeta=False, metaPlusIndex=False)[source]¶
returns an object with some attributes set.
This object is used in the parsing code in dddef. It’s a standin for the the command line options for tables created internally and should have all attributes that the parsing infrastructure might want from the optparse object.
So, just configure what you want via keyword arguments or use the prebuilt objects parseValidating and and parseNonValidating below.
See commandline.py for the meaning of the attributes.
The exception is buildDependencies. This is true for most internal builds of data (and thus here), but false when we need to manually control when dependencies are built, as in user.importing and while building the dependencies themselves.