diff options
author | jerous <jerous@gmail.com> | 2008-09-16 01:48:42 +0200 |
---|---|---|
committer | jerous <jerous@gmail.com> | 2008-09-16 01:48:42 +0200 |
commit | eff2866915826a248ac645544f3dd1f2b33f5b66 (patch) | |
tree | eb5f6efbada464d9c1a48abb479f1483aaa31e6c /plugins | |
parent | 6a3859be88453cb981d797e8223cba407471020d (diff) |
better notify format
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Notify.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/Notify.py b/plugins/Notify.py index d995d1c..970c55c 100644 --- a/plugins/Notify.py +++ b/plugins/Notify.py @@ -2,6 +2,7 @@ from PyQt4 import QtGui,QtCore from thread import start_new_thread from traceback import print_exc +import format from misc import * from clSettings import settings,mpdSettings from clMonty import monty @@ -37,7 +38,7 @@ class winNotify(QtGui.QWidget): monty.addListener('onVolumeChange', self.onVolumeChange) def onSongChange(self, params): - self.show('$if($artist,$artist$if($album, [$album #$track])\n$title ($length))', monty.getCurrentSong()) + self.show('$if($artist,$artist)$if($album, [$album #$track])\n$title ($length))', monty.getCurrentSong()) def onReady(self, params): self.show('montypc loaded!') @@ -58,7 +59,7 @@ class winNotify(QtGui.QWidget): if not self.isVisible(): self.setVisible(True) self.resizeWindow=True - self.msg=msg + self.msg=format.compile(msg) self.song=song self.xtra_tags=xtra_tags if self._timerID: @@ -85,7 +86,7 @@ class winNotify(QtGui.QWidget): spacing=10 # space between album cover and text # determine the Rect our message must fit in - txt="%s"%(format(self.msg, self.song, self.xtra_tags)) + txt=self.msg(format.params(self.song, self.xtra_tags)) rect=p.boundingRect(0,0,1,1, QtCore.Qt.AlignHCenter, txt) # check if 1/ albumcover plugin is loaded, and 2/ there is an |