From fb40ac54fc6e9fe79f29fd99e836187e95bb0509 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sat, 5 Mar 2011 21:42:56 +0100 Subject: Kind of big cleanup. Core and Connection classes are now used as singletons, we do not need to pass them to each Tab and Win. This remove a lot of arguments to varius methods. --- src/poezio.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/poezio.py') diff --git a/src/poezio.py b/src/poezio.py index cbe30f2a..bc93ec62 100644 --- a/src/poezio.py +++ b/src/poezio.py @@ -26,18 +26,17 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__))) import signal import logging -from connection import connection from config import config, options -from core import core +import singleton +import core +import connection if __name__ == '__main__': signal.signal(signal.SIGINT, signal.SIG_IGN) # ignore ctrl-c - sys.stderr = open('/dev/null', 'a') if options.debug: logging.basicConfig(filename=options.debug,level=logging.DEBUG) - if not connection.start(): # Connect to remote server - core.on_failed_connection() - # Disable any display of non-wanted text on the terminal - # by redirecting stderr to /dev/null - # sys.stderr = open('/dev/null', 'a') - core.main_loop() # Refresh the screen, wait for user events etc + the_core = singleton.Singleton(core.Core) + the_core.start() + if not the_core.xmpp.start(): # Connect to remote server + the_core.on_failed_connection() + the_core.main_loop() # Refresh the screen, wait for user events etc -- cgit v1.2.3