Browse Source

testing a small fix

tags/v0.1
Ben Kurtovic 13 years ago
parent
commit
2b990cd580
2 changed files with 6 additions and 8 deletions
  1. +5
    -6
      core/main.py
  2. +1
    -2
      irc/watcher.py

+ 5
- 6
core/main.py View File

@@ -30,7 +30,7 @@ def irc_watcher(f_conn):
except: except:
traceback.print_exc() traceback.print_exc()
time.sleep(5) # sleep a bit before restarting watcher time.sleep(5) # sleep a bit before restarting watcher
print "restarting watcher component..."
print "watcher has stopped; restarting component..."


def run(): def run():
global f_conn global f_conn
@@ -42,9 +42,8 @@ def run():


frontend.main(f_conn) frontend.main(f_conn)


w_conn.close()
f_conn.close()

if __name__ == "__main__": if __name__ == "__main__":
try:
run()
finally:
f_conn.close()
w_conn.close()
run()

+ 1
- 2
irc/watcher.py View File

@@ -21,10 +21,9 @@ def main(connection, f_conn):
read_buffer = str() read_buffer = str()


while 1: while 1:
try:
try:
read_buffer = read_buffer + connection.get() read_buffer = read_buffer + connection.get()
except RuntimeError: # socket broke except RuntimeError: # socket broke
print "socket has broken on watcher, restarting component..."
return return


lines = read_buffer.split("\n") lines = read_buffer.split("\n")


Loading…
Cancel
Save