Simplify redirecting output to the console

This commit is contained in:
Marco Pesenti Gritti
2006-05-23 16:02:13 -04:00
parent f2e9500a9b
commit 03af8bceea
5 changed files with 20 additions and 20 deletions
+7 -13
View File
@@ -696,17 +696,11 @@ class ChatShell(dbus.service.Object):
def send_text_message(self, message):
self._group_chat.send_text_message(message)
log_writer = LogWriter("Chat")
log_writer.start()
def main():
if len(sys.argv) > 1 and sys.argv[1] == "--console":
sys.stdout = LogWriter("Chat")
sys.stderr = LogWriter("Chat")
ChatShell.get_instance().open_group_chat()
try:
gtk.main()
except KeyboardInterrupt:
pass
if __name__ == "__main__":
main()
ChatShell.get_instance().open_group_chat()
try:
gtk.main()
except KeyboardInterrupt:
pass