diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-08-23 13:57:55 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-08-23 20:27:36 +0200 |
commit | e15061c283aea38ee6fffba4e81663550586c6fe (patch) | |
tree | 53e185d9202571f8afa8449ee22275ca9ecfd068 | |
parent | 94b55a0cfc9adb3110ba68e47d4981bea96bd1ed (diff) |
mpclient: change info from function to var.
-rw-r--r-- | nephilim/plugin.py | 3 | ||||
-rw-r--r-- | nephilim/plugins/AlbumCover.py | 5 | ||||
-rw-r--r-- | nephilim/plugins/Filebrowser.py | 7 | ||||
-rw-r--r-- | nephilim/plugins/Library.py | 4 | ||||
-rw-r--r-- | nephilim/plugins/Lyrics.py | 6 | ||||
-rw-r--r-- | nephilim/plugins/Notify.py | 10 | ||||
-rw-r--r-- | nephilim/plugins/PlayControl.py | 6 | ||||
-rw-r--r-- | nephilim/plugins/Playlist.py | 8 | ||||
-rw-r--r-- | nephilim/plugins/Songinfo.py | 7 | ||||
-rw-r--r-- | nephilim/plugins/Systray.py | 8 | ||||
-rw-r--r-- | nephilim/settings_wg.py | 2 |
11 files changed, 43 insertions, 23 deletions
diff --git a/nephilim/plugin.py b/nephilim/plugin.py index d4bad03..560081b 100644 --- a/nephilim/plugin.py +++ b/nephilim/plugin.py @@ -25,6 +25,7 @@ import plugins class Plugin(QtCore.QObject): # public, const name = None + info = None logger = None mpclient = None settings = None @@ -56,8 +57,6 @@ class Plugin(QtCore.QObject): self.settings.setValue(key, QVariant(self.DEFAULTS[key])) self.settings.endGroup() - def info(self): - return '' def parent(self): return self._parent def set_status(self, status): diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py index 737e466..db4d6f8 100644 --- a/nephilim/plugins/AlbumCover.py +++ b/nephilim/plugins/AlbumCover.py @@ -95,6 +95,9 @@ class AlbumCoverWidget(QtGui.QLabel): self.plugin.refresh() class AlbumCover(Plugin): + # public, constant + info = 'Display the album cover of the currently playing album.' + # public, read-only o = None @@ -319,7 +322,7 @@ class AlbumCover(Plugin): self.o = None self.mpclient.song_changed.disconnect(self.refresh) def info(self): - return "Display the album cover of the currently playing album." + return def refresh(self): self.logger.info('Autorefreshing cover.') diff --git a/nephilim/plugins/Filebrowser.py b/nephilim/plugins/Filebrowser.py index 925468a..d310789 100644 --- a/nephilim/plugins/Filebrowser.py +++ b/nephilim/plugins/Filebrowser.py @@ -23,6 +23,10 @@ import shutil from ..plugin import Plugin class Filebrowser(Plugin): + # public, const + info = 'A file browser that allows adding files not in collection.' + + # public, read-only o = None def _load(self): self.o = wgFilebrowser(self) @@ -30,9 +34,6 @@ class Filebrowser(Plugin): def _unload(self): self.o = None - def info(self): - return 'A file browser that allows adding files not in collection.' - def _get_dock_widget(self): return self._create_dock(self.o) diff --git a/nephilim/plugins/Library.py b/nephilim/plugins/Library.py index 27a91fd..74c5464 100644 --- a/nephilim/plugins/Library.py +++ b/nephilim/plugins/Library.py @@ -21,6 +21,10 @@ from PyQt4.QtCore import QVariant from ..plugin import Plugin class Library(Plugin): + # public, const + info = 'Display MPD database as a tree.' + + # public, read-only o=None DEFAULTS = {'modes' : QtCore.QStringList(['artist', 'artist/album', diff --git a/nephilim/plugins/Lyrics.py b/nephilim/plugins/Lyrics.py index c007f77..9217df8 100644 --- a/nephilim/plugins/Lyrics.py +++ b/nephilim/plugins/Lyrics.py @@ -101,6 +101,9 @@ class LyricsWidget(QtGui.QWidget): self.__text_view.insertPlainText('Lyrics not found.') class Lyrics(Plugin): + # public, const + info = 'Show (and fetch) the lyrics of the currently playing song.' + # public, read-only o = None @@ -333,9 +336,6 @@ class Lyrics(Plugin): self.o = None self.__fetchers = None self.mpclient.song_changed.disconnect(self.refresh) - def info(self): - return "Show (and fetch) the lyrics of the currently playing song." - def _get_dock_widget(self): return self._create_dock(self.o) diff --git a/nephilim/plugins/Notify.py b/nephilim/plugins/Notify.py index 30c6d9b..4a86cfb 100644 --- a/nephilim/plugins/Notify.py +++ b/nephilim/plugins/Notify.py @@ -97,7 +97,12 @@ class winNotify(QtGui.QWidget): self.move((screen.width()-size.width())/2, 100) class Notify(Plugin): - o=None + # public, const + info = 'Show notifications in a popup window.' + + # public, read-only + o = None + DEFAULTS = {'songformat' : '$track - $artist - $title ($album) [$length]', 'timer' : 3000} @@ -113,9 +118,6 @@ class Notify(Plugin): self.mpclient.connect_changed.disconnect(self.on_connect_changed) self.mpclient.state_changed.disconnect(self.onStateChange) self.mpclient.volume_changed.disconnect(self.onVolumeChange) - def getInfo(self): - return "Show interesting events in a popup window." - def onSongChange(self): song = self.mpclient.current_song() if not song: diff --git a/nephilim/plugins/PlayControl.py b/nephilim/plugins/PlayControl.py index b93dbdc..1338fea 100644 --- a/nephilim/plugins/PlayControl.py +++ b/nephilim/plugins/PlayControl.py @@ -141,6 +141,10 @@ class wgPlayControl(QtGui.QToolBar): self.p.mpclient.set_volume(self.vol_slider.value()) class PlayControl(Plugin): + # public, const + info = 'Controls playback.' + + # public, read-only o = None def _load(self): @@ -149,5 +153,3 @@ class PlayControl(Plugin): def _unload(self): QtGui.QApplication.instance().main_win.removeToolBar(self.o) self.o = None - def getInfo(self): - return "Have total control over the playing!" diff --git a/nephilim/plugins/Playlist.py b/nephilim/plugins/Playlist.py index 1f70021..44d7a40 100644 --- a/nephilim/plugins/Playlist.py +++ b/nephilim/plugins/Playlist.py @@ -21,7 +21,13 @@ from PyQt4.QtCore import QVariant from ..plugin import Plugin class Playlist(Plugin): + # public, const + info = 'Shows the playlist.' + + # public, read-only o = None + + # private DEFAULTS = {'columns': ['track', 'title', 'artist', 'date', 'album', 'length']} @@ -30,8 +36,6 @@ class Playlist(Plugin): def _unload(self): self.o = None - def info(self): - return "The playlist showing the songs that will be played." def _get_dock_widget(self): return self._create_dock(self.o) diff --git a/nephilim/plugins/Songinfo.py b/nephilim/plugins/Songinfo.py index 6334d67..960f179 100644 --- a/nephilim/plugins/Songinfo.py +++ b/nephilim/plugins/Songinfo.py @@ -20,6 +20,10 @@ from PyQt4 import QtGui, QtCore from ..plugin import Plugin class Songinfo(Plugin): + # public, const + info = 'Displays song metadata provided by MPD.' + + # public, read-only o = None def _load(self): self.o = SonginfoWidget(self) @@ -27,9 +31,6 @@ class Songinfo(Plugin): def _unload(self): self.o = None - def info(self): - return 'Provides information about a song.' - def _get_dock_widget(self): return self._create_dock(self.o) diff --git a/nephilim/plugins/Systray.py b/nephilim/plugins/Systray.py index b786d45..c909b4b 100644 --- a/nephilim/plugins/Systray.py +++ b/nephilim/plugins/Systray.py @@ -23,7 +23,13 @@ from ..plugin import Plugin from ..common import sec2min, APPNAME, appIcon, expand_tags class Systray(Plugin): + # public, const + info = 'Provides the systray icon.' + + # public, read-only o = None + + # private format = None eventObj = None DEFAULTS = {'format': '$track - $title by $artist on $album ($length)'} @@ -55,8 +61,6 @@ class Systray(Plugin): self.o.setIcon(QtGui.QIcon(None)) self.o = None self.parent()._wheelEvent = None - def getInfo(self): - return "Display the mpclientpc icon in the systray." def update(self): status = self.mpclient.status() diff --git a/nephilim/settings_wg.py b/nephilim/settings_wg.py index a75d3b2..145114a 100644 --- a/nephilim/settings_wg.py +++ b/nephilim/settings_wg.py @@ -157,7 +157,7 @@ class SettingsWidget(QtGui.QWidget): def fill_pluginlist(self): self.pluginlist.clear() for plugin in self.plugins.plugins(): - item = QtGui.QListWidgetItem("%s\t%s"%(plugin.name, plugin.info())) + item = QtGui.QListWidgetItem("%s\t%s"%(plugin.name, plugin.info)) if plugin.loaded: item.setCheckState(QtCore.Qt.Checked) else: |