Package gavo :: Module rscdesc :: Class RD
[frames] | no frames]

Class RD

source code

                   object --+            
                            |            
 base.structure.StructureBase --+        
                                |        
                   object --+   |        
                            |   |        
           base.common.Parser --+        
                                |        
base.structure.ParseableStructure --+    
                                    |    
             base.structure.Structure --+
                                        |
                       object --+       |
                                |       |
              base.meta.MetaMixin --+   |
                                    |   |
          base.meta.ComputedMetaMixin --+
                                        |
                           object --+   |
                                    |   |
      rscdef.scripting.ScriptingMixin --+
                                        |
                       object --+       |
                                |       |
         base.macros.MacroPackage --+   |
                                    |   |
       base.macros.StandardMacroMixin --+
                                        |
                           object --+   |
                                    |   |
        rscdef.common.PrivilegesMixin --+
                                        |
                           object --+   |
                                    |   |
     registry.common.DateUpdatedMixin --+
                                        |
                                       RD

A resource descriptor.

RDs collect all information about how to parse a particular source (like a collection of FITS images, a catalogue, or whatever), about the database tables the data ends up in, and the services used to access them.

In DaCHS' RD XML serialisation, they correspond to the root element.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods
 
__init__(self, srcId, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__iter__(self) source code
 
__repr__(self)
repr(x)
source code
 
validate(self) source code
 
isDirty(self)
returns true if the RD on disk has a timestamp newer than loadedAt.
source code
 
importModule(self, ctx) source code
 
onElementComplete(self) source code
 
iterDDs(self) source code
 
getService(self, id) source code
 
getTableDefById(self, id) source code
 
getDataDescById(self, id) source code
 
getById(self, id, forceType=None) source code
 
getAbsPath(self, relPath)
returns the absolute path for a resdir-relative relPath.
source code
 
openRes(self, relPath, mode='r')
returns a file object for relPath within self's resdir.
source code
 
getTimestampPath(self)
returns a path to a file that's accessed by Resource each time a bit of the described resource is written to the db.
source code
 
touchTimestamp(self)
updates the timestamp on the rd's state file.
source code
 
addDependency(self, rd, prereq)
declares that rd needs the RD prereq to properly work.
source code
 
copy(self, parent)
returns a deep copy of self, reparented to parent.
source code
 
invalidate(self)
make the RD fail on every attribute read.
source code
 
macro_RSTccbysa(self, stuffDesignation)
expands to a declaration that stuffDesignation is available under CC-BY-SA.
source code
 
macro_RSTccby(self, stuffDesignation)
expands to a declaration that stuffDesignation is available under CC-BY.
source code
 
macro_RSTcc0(self, stuffDesignation)
expands to a declaration that stuffDesignation is available under CC-0.
source code
 
clearProperty(self, name) source code
 
getProperty(self, name, default=<Undefined>) source code
 
hasProperty(self, name) source code
 
setProperty(self, name, value) source code

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, completeElement, finishElement

Inherited from base.structure.ParseableStructure: end_, feed, feedFrom, feedObject, getAttribute, iterEvents, start_, value_

Inherited from base.structure.StructureBase: __providedBy__, adopt, breakCircles, change, getAttributes, getCopyableAttributes, getSourcePosition, iterChildren, setPosition

Inherited from base.common.Parser: feedEvent

Inherited from base.meta.ComputedMetaMixin: getMetaKeys

Inherited from base.meta.MetaMixin: addMeta, buildRepr, copyMetaFrom, delMeta, getAllMetaPairs, getMeta, getMetaParent, isEmpty, iterMeta, keys, makeOriginal, setMeta, setMetaParent, traverse

Inherited from rscdef.scripting.ScriptingMixin: getRunner

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__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'resource'
a sentinel for all kinds of undefined values.
  cacheable = False
  attrSeq = [<gavo.base.meta.MetaAttribute object>, <gavo.base.c...
  managedAttrs = {'adqlCore': <gavo.base.complexattrs.MultiStruc...

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties
  resdir

Inherited from object: __class__

Method Details

__init__(self, srcId, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

validate(self)

source code 
Overrides: base.structure.Structure.validate

onElementComplete(self)

source code 
Overrides: base.structure.Structure.onElementComplete

openRes(self, relPath, mode='r')

source code 

returns a file object for relPath within self's resdir.

Deprecated. This is going to go away, use getAbsPath and a context manager.

addDependency(self, rd, prereq)

source code 

declares that rd needs the RD prereq to properly work.

This is used in the generation of resource records to ensure that, e.g. registred data have added their served-bys to the service resources.

copy(self, parent)

source code 

returns a deep copy of self, reparented to parent.

This is a shallow wrapper around change, present for backward compatibility.

Overrides: base.structure.StructureBase.copy
(inherited documentation)

invalidate(self)

source code 

make the RD fail on every attribute read.

See rscdesc._loadRDIntoCache for why we want this.

macro_RSTccbysa(self, stuffDesignation)

source code 

expands to a declaration that stuffDesignation is available under CC-BY-SA.

This only works in reStructured text (though it's still almost readable as source).

macro_RSTccby(self, stuffDesignation)

source code 

expands to a declaration that stuffDesignation is available under CC-BY.

This only works in reStructured text (though it's still almost readable as source).

macro_RSTcc0(self, stuffDesignation)

source code 

expands to a declaration that stuffDesignation is available under CC-0.

This only works in reStructured text (though it's still almost readable as source).


Class Variable Details

attrSeq

Value:
[<gavo.base.meta.MetaAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>,
 <gavo.base.complexattrs.MultiStructListAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>,
...

managedAttrs

Value:
{'adqlCore': <gavo.base.complexattrs.MultiStructListAttribute object>,
 'allProfiles': <gavo.rscdef.common.ProfileListAttribute object>,
 'condDesc': <gavo.base.complexattrs.StructListAttribute object>,
 'condDescs': <gavo.base.complexattrs.StructListAttribute object>,
 'cores': <gavo.base.complexattrs.MultiStructListAttribute object>,
 'coverage': <gavo.base.complexattrs.StructAttribute object>,
 'customCore': <gavo.base.complexattrs.MultiStructListAttribute object\
>,
...

Property Details

resdir

Get Method:
unreachable.computePath(instance)
Set Method:
unreachable.setRelative(instance, value)