From f52f2de6319b276e4463f9e779944d1bc246ed5b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 7 Dec 2010 21:41:34 +0100 Subject: nephilim_app: use templates for tags expanding this is kinda hacky and should be removed in the future --- nephilim/nephilim_app.py | 6 ++++-- 1 file 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 #### -- cgit v1.2.3