Changeset 4b0092e
- Timestamp:
- 2008-07-12T20:10:31Z (16 years ago)
- Branches:
- master
- Children:
- 6af3e14
- Parents:
- 9033a0a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skyped.py
r9033a0a r4b0092e 64 64 return True 65 65 66 def idle_handler(skype):66 def skype_idle_handler(skype): 67 67 try: 68 68 c = skype.skype.Command("PING", Block=True) … … 70 70 except Skype4Py.SkypeAPIError, s: 71 71 dprint("Warning, pinging Skype failed (%s)." % (s)) 72 return True 73 74 def bitlbee_idle_handler(skype): 75 if options.conn: 76 try: 77 e = "PING" 78 options.conn.send("%s\n" % e) 79 except Exception, s: 80 dprint("Warning, sending '%s' failed (%s)." % (e, s)) 81 options.conn.close() 72 82 return True 73 83 … … 162 172 163 173 def send(self, msg_text): 164 if not len(msg_text) :174 if not len(msg_text) or msg_text == "PONG": 165 175 return 166 176 e = msg_text.decode(locale.getdefaultlocale()[1]) … … 273 283 except Skype4Py.SkypeAPIError, s: 274 284 sys.exit("%s. Are you sure you have started Skype?" % s) 275 gobject.timeout_add(2000, idle_handler, skype) 285 gobject.timeout_add(2000, skype_idle_handler, skype) 286 gobject.timeout_add(60000, bitlbee_idle_handler, skype) 276 287 gobject.MainLoop().run()
Note: See TracChangeset
for help on using the changeset viewer.