示例#1
0
文件: attrs.py 项目: tdunn19/sunpy
    """ 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,
示例#2
0
文件: attrs.py 项目: timmie/sunpy
 def __init__(self, fielditem):
     ValueAttr.__init__(self, {
         ('field', 'fielditem'): fielditem
     })
示例#3
0
文件: attrs.py 项目: yudhik11/sunpy
def _convert(attr):
    return ValueAttr({
        ('wave', ): (attr.min.value, attr.max.value, str(attr.unit))
    })
示例#4
0
文件: attrs.py 项目: yudhik11/sunpy
def _convert(attr):
    return ValueAttr({('time', ): (attr.start, attr.end, attr.near)})
示例#5
0
文件: attrs.py 项目: yudhik11/sunpy
def _convert(attr):
    return ValueAttr({
        ('fitsheaderentry', ): (attr.key, attr.value, attr.inverted)
    })
示例#6
0
文件: attrs.py 项目: yudhik11/sunpy
def _convert(attr):
    return ValueAttr({(attr.__class__.__name__.lower(), ): attr.value})
示例#7
0
文件: attrs.py 项目: yudhik11/sunpy
def _convert(attr):
    return ValueAttr({('path', ): (attr.value, attr.inverted)})
示例#8
0
文件: attrs.py 项目: yudhik11/sunpy
def _convert(attr):
    return ValueAttr({
        ('download time', ): (attr.start, attr.end, attr.inverted)
    })
示例#9
0
文件: attrs.py 项目: yudhik11/sunpy
def _convert(attr):
    return ValueAttr({('starred', ): attr.value})
示例#10
0
文件: attrs.py 项目: yudhik11/sunpy
def _convert(attr):
    return ValueAttr({('tag', attr.inverted): attr.tagname})
示例#11
0
文件: attrs.py 项目: thilak007/sunpy
def _convert(attr):
    near = None if not attr.near else attr.near.datetime
    return ValueAttr({('time', ): (attr.start.datetime, attr.end.datetime, near)})
示例#12
0
 def __init__(self, fielditem):
     ValueAttr.__init__(self, {
         ('field', 'fielditem'): fielditem
     })
示例#13
0
def _convert(attr):
    return ValueAttr({('wave', ): (attr.min, attr.max, attr.unit)})