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
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
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
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
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
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