Changeset a618ea6 for skype/skyped.py
- Timestamp:
- 2010-12-13T03:37:30Z (14 years ago)
- Branches:
- master
- Children:
- 988d75c, eeab8bc
- Parents:
- 451f121
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skyped.py
r451f121 ra618ea6 38 38 39 39 def eh(type, value, tb): 40 global options 41 40 42 if type != KeyboardInterrupt: 41 43 print_exception(type, value, tb) 42 44 gobject.MainLoop().quit() 45 options.conn.close() 43 46 # shut down client if it's running 44 47 try: … … 75 78 return True 76 79 80 def send(sock, txt): 81 from time import sleep 82 count = 1 83 done = False 84 while (not done) and (count < 10): 85 try: 86 sock.send(txt) 87 done = True 88 except Exception, s: 89 count += 1 90 dprint("Warning, sending '%s' failed (%s). count=%d" % (txt, s, count)) 91 sleep(1) 92 if not done: 93 options.conn.close() 94 77 95 def bitlbee_idle_handler(skype): 78 96 if options.conn: 79 97 try: 80 98 e = "PING" 81 options.conn.send("%s\n" % e)99 send(options.conn, "%s\n" % e) 82 100 except Exception, s: 83 101 dprint("Warning, sending '%s' failed (%s)." % (e, s)) … … 137 155 if options.debug: 138 156 print now + ": " + msg 157 sys.stdout.flush() 139 158 if options.log: 140 159 sock = open(options.log, "a") … … 172 191 if options.conn: 173 192 try: 174 options.conn.send(e + "\n")193 send(options.conn, e + "\n") 175 194 except Exception, s: 176 195 dprint("Warning, sending '%s' failed (%s)." % (e, s))
Note: See TracChangeset
for help on using the changeset viewer.