comparison frontends/src/primitivus/primitivus @ 380:ede26abf6ca1

primitivus: freedesktop notifications (if available) when somebody is talking to us and we have not focus, or our nick is pinged and we have not focus. This need python-Xlib to work, if it's not present, notification are silently ignored.
author Goffi <goffi@goffi.org>
date Sat, 27 Aug 2011 17:15:41 +0200
parents a00e87d48213
children f6deca4e328e
comparison
equal deleted inserted replaced
379:adcc41e4d6ea 380:ede26abf6ca1
34 from sat_frontends.primitivus.progress import Progress 34 from sat_frontends.primitivus.progress import Progress
35 import logging 35 import logging
36 from logging import debug, info, error 36 from logging import debug, info, error
37 import sys, os 37 import sys, os
38 from sat.tools.jid import JID 38 from sat.tools.jid import JID
39 from notify import Notify
39 40
40 41
41 ### logging configuration FIXME: put this elsewhere ### 42 ### logging configuration FIXME: put this elsewhere ###
42 logging.basicConfig(level=logging.CRITICAL, #TODO: configure it to put messages in a log file 43 logging.basicConfig(level=logging.CRITICAL, #TODO: configure it to put messages in a log file
43 format='%(message)s') 44 format='%(message)s')
102 self.notBar = sat_widgets.NotificationBar() 103 self.notBar = sat_widgets.NotificationBar()
103 urwid.connect_signal(self.notBar,'change',self.onNotification) 104 urwid.connect_signal(self.notBar,'change',self.onNotification)
104 self.progress_wid = Progress(self) 105 self.progress_wid = Progress(self)
105 urwid.connect_signal(self.notBar.progress,'click',lambda x:self.addWindow(self.progress_wid)) 106 urwid.connect_signal(self.notBar.progress,'click',lambda x:self.addWindow(self.progress_wid))
106 self.__saved_overlay = None 107 self.__saved_overlay = None
108
109 self.notify = Notify()
107 110
108 def debug(self): 111 def debug(self):
109 """convenient method to reset screen and launch p(u)db""" 112 """convenient method to reset screen and launch p(u)db"""
110 try: 113 try:
111 import pudb 114 import pudb