Пример #1
0
def findEventDate(eventID):
    searchResults = request(collection='OuvertureGranule',
                            filters={'SyndicObjectId': eventID})
    return ((default.date_type_wrapped(
                event['Datedebut'],
                default.TOURINFO_DATE_FORMAT
             ),
             default.date_type_wrapped(
                event['Datefin'],
                default.TOURINFO_DATE_FORMAT
             ))
            for event in searchResults)
Пример #2
0
def gen_value_compare(property1, property2, event=False):
    same, diff = (0, 0)
    for tobject in request(event=event):
        f = 0
        for key, value in tobject.items():
            if key.lower().startswith(property1):
                f += 1
            if key.lower().startswith(property2):
                f += 1
        if f == 2:
            same += 1
        else:
            diff += 1
    return(same, diff)
Пример #3
0
def gen_key(property, event=False):
    for tobject in request(event=event):
        for key, value in tobject.items():
            if key.lower().startswith(property):
                yield key