diff options
author | Anton Khirnov <anton@khirnov.net> | 2010-12-07 21:41:34 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2010-12-07 21:41:34 +0100 |
commit | f52f2de6319b276e4463f9e779944d1bc246ed5b (patch) | |
tree | 1f6d1a3af2c13a54c0ffe6240bf9fbd184962532 | |
parent | fe25e1469cddc0c99943d04f15df913d35382f96 (diff) |
nephilim_app: use templates for tags expanding
this is kinda hacky and should be removed in the future
-rw-r--r-- | nephilim/nephilim_app.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nephilim/nephilim_app.py b/nephilim/nephilim_app.py index da387a7..b03245d 100644 --- a/nephilim/nephilim_app.py +++ b/nephilim/nephilim_app.py @@ -16,6 +16,7 @@ # from PyQt4 import QtGui, QtCore +from string import Template from main_window import MainWindow from common import ORGNAME, APPNAME, appIcon @@ -98,8 +99,9 @@ class NephilimApp(QtGui.QApplication): self._connect_win.monitor() def expand_tags(self, str): - ret = str - ret = ret.replace('${musicdir}', self.settings.value('MPD/music_dir')) + replacements = {'musicdir' : self.settings.value('MPD/music_dir')} + ret = Template(str) + ret = ret.safe_substitute(replacements) return ret #### PRIVATE #### |