diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-03-05 21:42:56 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-03-05 21:42:56 +0100 |
commit | fb40ac54fc6e9fe79f29fd99e836187e95bb0509 (patch) | |
tree | 19bced4c4e2fb557b150553b66335b14bdc1ab85 /src/poezio.py | |
parent | 9c291d1368f004828b123edca65f11c4f6e96dfc (diff) | |
download | poezio-fb40ac54fc6e9fe79f29fd99e836187e95bb0509.tar.gz poezio-fb40ac54fc6e9fe79f29fd99e836187e95bb0509.tar.bz2 poezio-fb40ac54fc6e9fe79f29fd99e836187e95bb0509.tar.xz poezio-fb40ac54fc6e9fe79f29fd99e836187e95bb0509.zip |
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.
Diffstat (limited to 'src/poezio.py')
-rw-r--r-- | src/poezio.py | 17 |
1 files changed, 8 insertions, 9 deletions
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 |