Exemple #1
0
    def __init__(self, parent, **kwargs):
        if self.inputTableXML is not None:
            if "inputTable" not in kwargs:
                kwargs["inputTable"] = base.parseFromString(
                    inputdef.InputTable, self.inputTableXML)

        base.Structure.__init__(self, parent, **kwargs)
Exemple #2
0
def makeConeSearchFor(inputKey):
    """returns an //scs#makeSpointCD condDesc tailored for inputKey.
	"""
    from gavo.svcs import standardcores
    return base.parseFromString(
        standardcores.CondDesc, """
		<FEED source="//scs#makeSpointCD"
			tablehead=%s
			matchColumn=%s/>
		""" % (utils.escapeAttrVal(
            inputKey.tablehead), utils.escapeAttrVal(inputKey.name)))
Exemple #3
0
def makeDataForFITS(rd, srcName, opts):
    targetTable = rd.tables[0]
    dd = rscdef.DataDescriptor(rd, id="import_" + opts.tableName)
    grammar = fitsprodgrammar.FITSProdGrammar(dd)
    grammar.feedObject("qnd", True)
    rowfilter = base.parseFromString(
        grammars.Rowfilter, """
		<rowfilter procDef="//products#define">
				<bind key="table">"%s"</bind>
				<bind key="owner">"FILLIN"</bind>
				<bind key="embargo">"FILLIN"</bind>
		</rowfilter>""" % (targetTable.getQName()))
    grammar.feedObject("rowfilter", rowfilter)
    grammar.feedObject(
        "mapKeys", MS(grammars.MapKeys, content_=rd.getProperty("mapKeys")))
    grammar.finishElement()
    dd.grammar = grammar
    dd.feedObject("sources",
                  MS(rscdef.SourceSpec, pattern=["*.fits"], recurse=True))
    dd.feedObject("rowmaker", MS(rscdef.RowmakerDef, idmaps="*", id="gen_rmk"))
    dd.feedObject("make", MS(rscdef.Make,
                             table=targetTable,
                             rowmaker="gen_rmk"))
    return dd
Exemple #4
0
 def __call__(self, parent):
     if parent._ot_prototype is None:
         ot = outputdef.OutputTableDef(parent)
         parent._ot_prototype = base.parseFromString(
             ot, parent.outputTableXML or "<outputTable/>")
     return parent._ot_prototype.copy(parent)
 def completeElement(self, ctx):
     if self.outputTable is base.Undefined:
         self.outputTable = base.parseFromString(outputdef.OutputTableDef,
                                                 uploadOutputDef)
     self._completeElementNext(EditCore, ctx)