shorter
This commit is contained in:
parent
67844ff1dc
commit
9024cf474e
|
@ -49,7 +49,7 @@ def dbus_get_interface():
|
||||||
return dbus.Interface(obj, 'org.freedesktop.Notifications')
|
return dbus.Interface(obj, 'org.freedesktop.Notifications')
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
return None
|
return None
|
||||||
except dbus.dbus_bindings.DBusException, e:
|
except dbus.DBusException, e:
|
||||||
# This exception could give useful info about why notification breaks
|
# This exception could give useful info about why notification breaks
|
||||||
print >> sys.stderr, e
|
print >> sys.stderr, e
|
||||||
return None
|
return None
|
||||||
|
@ -124,7 +124,7 @@ def dbus_notify(event_type, jid, account, msg_type = '', file_props = None):
|
||||||
path = os.path.abspath(path)
|
path = os.path.abspath(path)
|
||||||
notif = dbus_get_interface()
|
notif = dbus_get_interface()
|
||||||
if notif is None:
|
if notif is None:
|
||||||
raise dbus.dbus_bindings.DBusException()
|
raise dbus.DBusException()
|
||||||
notif.Notify(dbus.String(_('Gajim')),
|
notif.Notify(dbus.String(_('Gajim')),
|
||||||
dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0),
|
dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0),
|
||||||
dbus.String(event_type), dbus.String(txt),
|
dbus.String(event_type), dbus.String(txt),
|
||||||
|
@ -135,7 +135,7 @@ def notify(event_type, jid, account, msg_type = '', file_props = None):
|
||||||
try:
|
try:
|
||||||
dbus_notify(event_type, jid, account, msg_type, file_props)
|
dbus_notify(event_type, jid, account, msg_type, file_props)
|
||||||
return
|
return
|
||||||
except dbus.dbus_bindings.DBusException, e:
|
except dbus.DBusException, e:
|
||||||
# Connection to DBus failed, try popup
|
# Connection to DBus failed, try popup
|
||||||
pass
|
pass
|
||||||
except TypeError, e:
|
except TypeError, e:
|
||||||
|
|
Loading…
Reference in New Issue