Beispiel #1
0
def tell_location(query):
    items = []

    if len(query.strip()) > 0:
        results = wunderground.autocomplete(query)
        for result in [r for r in results if r['type'] == 'city']:
            items.append(alfred.Item(result['name'], arg=result['name'],
                                     valid=True))

    return items
Beispiel #2
0
def tell_location(query):
    items = []

    if len(query.strip()) > 0:
        results = wunderground.autocomplete(query)
        for result in [r for r in results if r['type'] == 'city']:
            items.append(
                alfred.Item(result['name'], arg=result['name'], valid=True))

    return items
Beispiel #3
0
    def tell_location(self, query):
        items = []
        query = query.strip()

        if len(query) > 0:
            results = wunderground.autocomplete(query)
            for result in [r for r in results if r['type'] == 'city']:
                items.append(Item(result['name'], arg='location|' + result['name'],
                                  valid=True))
        else:
            items.append(Item('Enter a location...'))

        return items
Beispiel #4
0
def tell_location(query):
    items = []

    if len(query.strip()) > 0:
        LOG.debug('Getting location(s) with query "{}"'.format(query))
        results = wunderground.autocomplete(query)
        LOG.debug('Got {} results'.format(len(results)))
        for result in [r for r in results if r['type'] == 'city']:
            items.append(alfred.Item(result['name'], arg=result['name'],
                                     valid=True))
    else:
        LOG.debug('Empty query')

    return items
Beispiel #5
0
def tell_location(query):
    items = []

    if len(query.strip()) > 0:
        LOG.debug('Getting location(s) with query "{}"'.format(query))
        results = wunderground.autocomplete(query)
        LOG.debug('Got {} results'.format(len(results)))
        for result in [r for r in results if r['type'] == 'city']:
            items.append(
                alfred.Item(result['name'], arg=result['name'], valid=True))
    else:
        LOG.debug('Empty query')

    return items
Beispiel #6
0
    def tell_location(self, query, prefix=None):
        items = []
        query = query.strip()

        if len(query) > 0:
            results = wunderground.autocomplete(query)
            for result in [r for r in results if r['type'] == 'city']:
                items.append(
                    Item(result['name'],
                         arg='location|' + result['name'],
                         valid=True))
        else:
            items.append(Item('Enter a location...'))

        return items