From 767ef60818ffd46eea1a0f5548d95adf7d14811c Mon Sep 17 00:00:00 2001 From: Josh Davis Date: Sat, 16 Aug 2008 15:16:57 +1000 Subject: [PATCH] fix bug that craped with console and state before torc starting --- torc/torc.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/torc/torc.py b/torc/torc.py index b702cb2..b22c612 100755 --- a/torc/torc.py +++ b/torc/torc.py @@ -52,10 +52,11 @@ class TXTor: @test def go(self): - pytx.init() + self.config = Config("torc.conf", DEFAULT_PREFS) self.core = self.get_core() + l = Views(pytx.FOCUS|pytx.SCROLL|pytx.SEPARATOR|pytx.TITLES|pytx.HIGHLIGHT, 6) l.view_add(Torrents(self.core)) l.view_add(Files(self.core)) @@ -68,8 +69,8 @@ class TXTor: b.add(l); b.add(m); b.add(s) pytx.adjust() - logging.root.removeHandler(logging.root.handlers[0]) - logging.basicConfig(level=logging.DEBUG, format='%(message)s', stream=FakeIO(m.msg, m.draw)) + stream=FakeIO(m.msg, m.draw) + logging.root.handlers[0].stream = stream s.idle_cb() b.draw() @@ -83,7 +84,6 @@ class TXTor: pytx.operate() self.looping = False - pytx.free() @test @@ -94,10 +94,16 @@ class TXTor: @test def shutdown(self): - pytx.free() - pytx.emergency() + pass + def main(): + if len(sys.argv) == 1: host = None if len(sys.argv) == 2: host = sys.argv[1] + + pytx.init() PyroClient(TXTor, host) + pytx.free() + logging.root.handlers[0].stream = sys.stderr + -- 2.11.4.GIT