o2on svn commit
o2on-****@lists*****
2009年 8月 16日 (日) 16:11:49 JST
Revision: 164 http://sourceforge.jp/projects/o2on/svn/view?view=rev&revision=164 Author: nawota Date: 2009-08-16 16:11:49 +0900 (Sun, 16 Aug 2009) Log Message: ----------- logger.popup() fallback to logger.log() when dbus is not supported. Modified Paths: -------------- trunk/opy2on/lib/o2on_util.py Modified: trunk/opy2on/lib/o2on_util.py =================================================================== --- trunk/opy2on/lib/o2on_util.py 2009-08-13 00:57:06 UTC (rev 163) +++ trunk/opy2on/lib/o2on_util.py 2009-08-16 07:11:49 UTC (rev 164) @@ -44,11 +44,14 @@ print l def popup(self, categ, s): if o2on_config.UseDBus: - if not self.bus: self.bus = dbus.SessionBus() - obj = self.bus.get_object("org.freedesktop.Notifications", - "/org/freedesktop/Notifications") - obj.Notify(AppName, 0, '', AppName+" "+categ,s, [], {}, -1, - dbus_interface="org.freedesktop.Notifications") + try: + if not self.bus: self.bus = dbus.SessionBus() + obj = self.bus.get_object("org.freedesktop.Notifications", + "/org/freedesktop/Notifications") + obj.Notify(AppName, 0, '', AppName+" "+categ,s, [], {}, -1, + dbus_interface="org.freedesktop.Notifications") + except dbus.exceptions.DBusException: + self.log(categ,s) else: self.log(categ, s)