From 6b503543ae75fcd1172e9c557b6ed2752aa4d943 Mon Sep 17 00:00:00 2001 From: Rael Date: Wed, 18 Nov 2015 14:03:46 -0200 Subject: Better code for sendMessage replacement (#292) --- scudcloud-1.0/lib/wrapper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scudcloud-1.0/lib/wrapper.py b/scudcloud-1.0/lib/wrapper.py index f018163..13be430 100644 --- a/scudcloud-1.0/lib/wrapper.py +++ b/scudcloud-1.0/lib/wrapper.py @@ -173,6 +173,9 @@ class Wrapper(QWebView): @QtCore.pyqtSlot(str, str) def sendMessage(self, title, message): - self.window.notify(str(title).replace('New message from ', '', 1).replace('New message in ', '', 1).replace('['+self.name.lower()+'] in ', '', 1), str(message), self.icon) + erase = ['New message from ', 'New message in ', '['+self.name.lower()+'] in '] + for s in erase: + title = str(title).replace(s, '', 1) + self.window.notify(title, str(message), self.icon) -- cgit v1.1