Stick main code into main()

This commit is contained in:
Dan Williams 2006-05-22 11:47:59 -04:00
parent 6658cfba80
commit 58ed74bae6

View File

@ -652,13 +652,18 @@ class ChatShell(dbus.service.Object):
def send_text_message(self, message):
self._group_chat.send_text_message(message)
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.threads_init()
gtk.main()
except KeyboardInterrupt:
pass
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.threads_init()
gtk.main()
except KeyboardInterrupt:
pass
if __name__ == "__main__":
main()