parent
f321d52d24
commit
b4e30ff003
10
src/gajim.py
10
src/gajim.py
|
@ -435,11 +435,19 @@ class GlibIdleQueue(idlequeue.IdleQueue):
|
||||||
''' this method is called when we plug a new idle object.
|
''' this method is called when we plug a new idle object.
|
||||||
Start listening for events from fd
|
Start listening for events from fd
|
||||||
'''
|
'''
|
||||||
res = gobject.io_add_watch(fd, flags, self.process_events,
|
res = gobject.io_add_watch(fd, flags, self._process_events,
|
||||||
priority=gobject.PRIORITY_LOW)
|
priority=gobject.PRIORITY_LOW)
|
||||||
# store the id of the watch, so that we can remove it on unplug
|
# store the id of the watch, so that we can remove it on unplug
|
||||||
self.events[fd] = res
|
self.events[fd] = res
|
||||||
|
|
||||||
|
def _process_events(self, fd, flags):
|
||||||
|
try:
|
||||||
|
return self.process_events(fd, flags)
|
||||||
|
except:
|
||||||
|
self.remove_idle(fd)
|
||||||
|
self.add_idle(fd, flags)
|
||||||
|
raise
|
||||||
|
|
||||||
def remove_idle(self, fd):
|
def remove_idle(self, fd):
|
||||||
''' this method is called when we unplug a new idle object.
|
''' this method is called when we unplug a new idle object.
|
||||||
Stop listening for events from fd
|
Stop listening for events from fd
|
||||||
|
|
Loading…
Reference in New Issue