def get_items(self): yield SourceLeaf( AuthorsSource(self.library_path, name=_("<Calibre Authors>"))) yield SourceLeaf( SeriesSource(self.library_path, name=_("<Calibre Series>"))) for book in get_books_from_library(self.library_path): yield book
def get_items(self): yield StopTrackingLeaf() yield ShowHamsterInfo() activities_source = ActivitiesSource() yield SourceLeaf(activities_source) facts_source = FactsSource() yield SourceLeaf(facts_source) if __kupfer_settings__["toplevel_activities"]: for leaf in activities_source.get_leaves(): yield leaf
class XMMS2Source(AppLeafContentMixin, Source): appleaf_content_id = "xmms2" def __init__(self): Source.__init__(self, _("XMMS2")) def get_items(self): try: dbfile = config.get_config_file("medialib.db", package="xmms2") songs = list(get_xmms2_songs(dbfile)) except StandardError, e: self.output_error(e) songs = [] albums = parse_albums(songs) artists = parse_artists(songs) yield Play() yield Pause() yield Next() yield Previous() yield ClearQueue() yield ToggleRepeat() yield Shuffle() yield ShowPlaying() artist_source = XMMS2ArtistsSource(artists) album_source = XMMS2AlbumsSource(albums) songs_source = XMMS2SongsSource(artists) yield SourceLeaf(artist_source) yield SourceLeaf(album_source) yield SourceLeaf(songs_source) # we use get_leaves here to get sorting etc right if __kupfer_settings__["toplevel_artists"]: for leaf in artist_source.get_leaves(): yield leaf if __kupfer_settings__["toplevel_albums"]: for leaf in album_source.get_leaves(): yield leaf if __kupfer_settings__["toplevel_songs"]: for leaf in songs_source.get_leaves(): yield leaf
class RhythmboxSource(AppLeafContentMixin, Source): appleaf_content_id = "rhythmbox" def __init__(self): Source.__init__(self, _("Rhythmbox")) def get_items(self): # first try to load songs via dbus songs = list(_get_all_songs_via_dbus()) if not songs: try: dbfile = config.get_data_file("rhythmdb.xml", "rhythmbox") songs = rhythmbox_support.get_rhythmbox_songs(dbfile=dbfile) except StandardError, e: self.output_error(e) songs = [] albums = rhythmbox_support.parse_rhythmbox_albums(songs) artists = rhythmbox_support.parse_rhythmbox_artists(songs) yield Play() yield Pause() yield Next() yield Previous() yield ClearQueue() yield ShowPlaying() artist_source = RhythmboxArtistsSource(artists) album_source = RhythmboxAlbumsSource(albums) songs_source = RhythmboxSongsSource(artists) yield SourceLeaf(artist_source) yield SourceLeaf(album_source) yield SourceLeaf(songs_source) # we use get_leaves here to get sorting etc right if __kupfer_settings__["toplevel_artists"]: for leaf in artist_source.get_leaves(): yield leaf if __kupfer_settings__["toplevel_albums"]: for leaf in album_source.get_leaves(): yield leaf if __kupfer_settings__["toplevel_songs"]: for leaf in songs_source.get_leaves(): yield leaf
def get_items(self): # first try to load songs via dbus songs = list(_get_all_songs_via_dbus()) albums = rhythmbox_support.parse_rhythmbox_albums(songs) artists = rhythmbox_support.parse_rhythmbox_artists(songs) yield ClearQueue() artist_source = RhythmboxArtistsSource(artists) album_source = RhythmboxAlbumsSource(albums) songs_source = RhythmboxSongsSource(artists) yield SourceLeaf(artist_source) yield SourceLeaf(album_source) yield SourceLeaf(songs_source) # we use get_leaves here to get sorting etc right if __kupfer_settings__["toplevel_artists"]: for leaf in artist_source.get_leaves(): yield leaf if __kupfer_settings__["toplevel_albums"]: for leaf in album_source.get_leaves(): yield leaf if __kupfer_settings__["toplevel_songs"]: for leaf in songs_source.get_leaves(): yield leaf
def get_items(self): yield Play() yield Pause() yield Next() yield Previous() yield ClearQueue() # Commented as these seem to have no effect #yield Shuffle() #yield Repeat() songs = list(get_playlist_songs()) songs_source = AudaciousSongsSource(songs) yield SourceLeaf(songs_source) if __kupfer_settings__["playlist_toplevel"]: for leaf in songs_source.get_leaves(): yield leaf
def get_items(self): for tag in get_tracker_tags(): src = TrackerTagObjectsSource(tag) yield SourceLeaf(src)
def get_items(self): it = gtk.icon_theme_get_default() yield SourceLeaf(IconThemeCategorySource(None)) for ctx in it.list_contexts(): yield SourceLeaf(IconThemeCategorySource(ctx))
def get_items(self): yield SourceLeaf(AllBooksSource()) yield SourceLeaf(AuthorsSource()) yield SourceLeaf(SeriesSource()) for library in get_libraries(): yield SourceLeaf(LibraryBooksSource(library))