示例#1
0
 def search_finished(self, results, error):
     """
     Populate song list with search results.
     """
     if error:
         notification_area.notify('Failed to search: {}'.format(str(error)))
     else:
         self.songlist.populate(results.get_tracks())
         self.app.redraw()
示例#2
0
文件: stations.py 项目: agg23/clay
    def on_station_loaded(self, station, error):
        """
        Called when station  tracks  fetch completes.
        Populates songlist with tracks from the selected station.
        """
        if error:
            notification_area.notify('Failed to get station tracks: {}'.format(
                str(error)))

        self.songlist.populate(station.get_tracks())
        self.app.redraw()
示例#3
0
文件: page.py 项目: thor/clay
    def populate(self, values, error=None):
        if error:
            notification_area.notify("Failed to fetch {}: {}".format(
                str(error), self.__class__.__name__))

        self._items = []

        for item in values:
            item = AbstractListItem(item, self._icon)
            urwid.connect_signal(item, 'activate', self.item_activated)
            self._items.append(item)

        self.walker[:] = self._items
        self.app.redraw()