Skip to content

Commit

Permalink
Merge pull request #1 from mothsART/feature/non-bloking-notification
Browse files Browse the repository at this point in the history
encapsulate notification into try/catch
  • Loading branch information
lusum authored Oct 18, 2018
2 parents 560d59e + bc0a461 commit fb746e3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gSpeech.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,16 @@ def onExecute(self, widget, data=None):
text = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD).wait_for_text()

if text == None :
Notify.Notification.new(APPNAME, _(u"No text selected."), self.icon).show()
try:
Notify.Notification.new(APPNAME, _(u"No text selected."), self.icon).show()
except:
pass

else :
Notify.Notification.new(APPNAME, _(u"I'm reading the text. One moment please."), self.icon).show()
try:
Notify.Notification.new(APPNAME, _(u"I'm reading the text. One moment please."), self.icon).show()
except:
pass

#~ text = text.lower()
text = text.replace('\"', '')
Expand Down

0 comments on commit fb746e3

Please sign in to comment.