Package gavo :: Package rscdef :: Module rmkdef :: Class RowmakerMacroMixin
[frames] | no frames]

Class RowmakerMacroMixin

source code

                object --+        
                         |        
  base.macros.MacroPackage --+    
                             |    
base.macros.StandardMacroMixin --+
                                 |
                                RowmakerMacroMixin
Known Subclasses:

A collection of macros available to rowmakers.

NOTE: All macros should return only one single physical python line, or they will mess up the calculation of what constructs caused errors.

Instance Methods
 
macro_standardPubDID(self)
returns the "standard publisher DID" for the current product.
source code
 
macro_dlMetaURI(self, dlId)
returns a link to the datalink document for the current product.
source code
 
macro_fullPath(self)
returns an expression expanding to the full path of the current input file.
source code
 
macro_inputRelativePath(self, liberalChars='True')
see grammars.common.GrammarMacroMixin
source code
 
macro_rowsProcessed(self)
returns an expression giving the number of records already delivered by the grammar.
source code
 
macro_rowsMade(self)
returns an expression giving the number of records already returned by this row maker.
source code
 
macro_property(self, propName)
returns an expression giving the value of the property propName on the current DD.
source code
 
macro_sourceDate(self)
returns an expression giving the timestamp of the current source.
source code
 
macro_sourceCDate(self)
returns an expression giving the timestamp for the create date of the current source.
source code
 
macro_srcstem(self)
returns python code for the stem of the source file currently parsed in a rowmaker.
source code
 
macro_lastSourceElements(self, numElements)
returns an expression calling rmkfuncs.lastSourceElements on the current input path.
source code
 
macro_rootlessPath(self)
returns an expression giving the current source's path with the resource descriptor's root removed.
source code
 
macro_inputSize(self)
returns an expression giving the size of the current source.
source code
 
macro_docField(self, name)
returns an expression giving the value of the column name in the document row.
source code
 
macro_qName(self)
returns the qName of the table we are currently parsing into.
source code

Inherited from base.macros.StandardMacroMixin: macro_RSTservicelink, macro_RSTtable, macro_decapitalize, macro_getConfig, macro_internallink, macro_magicEmpty, macro_metaSeq, macro_metaString, macro_rdId, macro_rdIdDotted, macro_schema, macro_test, macro_today, macro_upper, macro_urlquote

Inherited from base.macros.MacroPackage: execMacro, expand, getExpander, listMacros, macro_quote, macro_reSub, macro_sql_standardPubDID, macro_sqlquote

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

macro_standardPubDID(self)

source code 

returns the "standard publisher DID" for the current product.

The publisher dataset identifier (PubDID) is important in protocols like SSAP and obscore. If you use this macro, the PubDID will be your authority, the path compontent ~, and the current value of @prodtblAccref. It thus will only work where products#define (or a replacement) is in action. If it isn't, a normal function call getStandardPubDID(\inputRelativePath) would be an obvious alternative.

You can of course define your PubDIDs in a different way.

macro_dlMetaURI(self, dlId)

source code 

returns a link to the datalink document for the current product.

This assumes you're assinging standard pubDIDs (see also standardPubDID, which is used by this).

dlId is the XML id of the datalink service, which is supposed to be in the sameRD as the rowmaker.

macro_rowsMade(self)

source code 

returns an expression giving the number of records already returned by this row maker.

This number excludes failed and skipped rows.

macro_sourceDate(self)

source code 

returns an expression giving the timestamp of the current source.

This is a timestamp of the modification date; use dateTimeToJdn or dateTimeToMJD to turn this into JD or MJD (which is usually preferred in database tables). See also the sourceCDate macro.

macro_sourceCDate(self)

source code 

returns an expression giving the timestamp for the create date of the current source.

Use dateTimeToJdn or dateTimeToMJD to turn this into JD or MJD (which is usually preferred in database tables). See also the sourceDate macro.

macro_srcstem(self)

source code 

returns python code for the stem of the source file currently parsed in a rowmaker.

Example: if you're currently parsing /tmp/foo.bar.gz, the stem is foo.