Changeset 53eb75c
- Timestamp:
- 2010-12-29T01:49:32Z (14 years ago)
- Branches:
- master
- Children:
- 5eb78c0
- Parents:
- ae8cc50
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skyped.py
rae8cc50 r53eb75c 43 43 if type != KeyboardInterrupt: 44 44 print_exception(type, value, tb) 45 if options.conn: options.conn.close() 45 if options.conn: 46 options.conn.close() 46 47 # shut down client if it's running 47 48 try: … … 99 100 c = skype.skype.Command("PING", Block=True) 100 101 skype.skype.SendCommand(c) 101 dprint("... skype pinged")102 102 except Skype4Py.SkypeAPIError, s: 103 103 dprint("Warning, pinging Skype failed (%s)." % (s)) … … 120 120 time.sleep(1) 121 121 if not done: 122 if options.conn: options.conn.close() 122 if options.conn: 123 options.conn.close() 123 124 options.conn = False 124 125 return done … … 131 132 e = "PING" 132 133 done = send(options.conn, "%s\n" % e) 133 dprint("... pinged Bitlbee")134 134 except Exception, s: 135 135 dprint("Warning, sending '%s' failed (%s)." % (e, s)) … … 243 243 options.conn = False 244 244 else: 245 dprint('-- -' + e)245 dprint('-- ' + e) 246 246 247 247 def send(self, msg_text): 248 248 if not len(msg_text) or msg_text == "PONG": 249 if msg_text == "PONG": options.last_bitlbee_pong = time.time() 249 if msg_text == "PONG": 250 options.last_bitlbee_pong = time.time() 250 251 return 251 252 try: … … 338 339 # TODO is following line necessary? Should there be a options.conn.unwrap() somewhere? 339 340 # options.conn.shutdown() 340 if options.conn: options.conn.close() 341 if options.conn: 342 options.conn.close() 341 343 options.conn = False 342 else:343 dprint("%f seconds since last PONG" % (now - options.last_bitlbee_pong))344 344 else: 345 345 options.last_bitlbee_pong = now 346 dprint("Serverloop done")347 346 348 347 if __name__=='__main__':
Note: See TracChangeset
for help on using the changeset viewer.