""" Implementation detail. """ return api.factory.create('QueryRequestBlock') @walker.add_applier(DummyAttr) # pylint: disable=E0102,C0103,W0613 def _apply(wlk, root, api, queryblock): """ Implementation detail. """ pass # Converters take a type unknown to the walker and convert it into one # known to it. All of those convert types into ValueAttrs, which are # handled above by just assigning according to the keys and values of the # attrs member. walker.add_converter(Extent)(lambda x: ValueAttr( dict((('extent', k), v) for k, v in vars(x).iteritems()))) walker.add_converter(Time)(lambda x: ValueAttr({ ('time', 'start'): x.start.strftime(TIMEFORMAT), ('time', 'end'): x.end.strftime(TIMEFORMAT), ('time', 'near'): (x.near.strftime(TIMEFORMAT) if x.near is not None else None), })) walker.add_converter(_VSOSimpleAttr)( lambda x: ValueAttr({(x.__class__.__name__.lower(), ): x.value})) walker.add_converter(Wave)(lambda x: ValueAttr({ ('wave', 'wavemin'): x.min,
def __init__(self, fielditem): ValueAttr.__init__(self, { ('field', 'fielditem'): fielditem })
def _convert(attr): return ValueAttr({ ('wave', ): (attr.min.value, attr.max.value, str(attr.unit)) })
def _convert(attr): return ValueAttr({('time', ): (attr.start, attr.end, attr.near)})
def _convert(attr): return ValueAttr({ ('fitsheaderentry', ): (attr.key, attr.value, attr.inverted) })
def _convert(attr): return ValueAttr({(attr.__class__.__name__.lower(), ): attr.value})
def _convert(attr): return ValueAttr({('path', ): (attr.value, attr.inverted)})
def _convert(attr): return ValueAttr({ ('download time', ): (attr.start, attr.end, attr.inverted) })
def _convert(attr): return ValueAttr({('starred', ): attr.value})
def _convert(attr): return ValueAttr({('tag', attr.inverted): attr.tagname})
def _convert(attr): near = None if not attr.near else attr.near.datetime return ValueAttr({('time', ): (attr.start.datetime, attr.end.datetime, near)})
def __init__(self, fielditem): ValueAttr.__init__(self, { ('field', 'fielditem'): fielditem })
def _convert(attr): return ValueAttr({('wave', ): (attr.min, attr.max, attr.unit)})