summaryrefslogtreecommitdiff
path: root/src/poezio.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-06 17:17:51 +0200
committermathieui <mathieui@mathieui.net>2014-04-06 17:26:21 +0200
commitfe070163228fba339445483883a05d0178f321cd (patch)
treeb425431109cb0e426f2261763dc5f0df6ddadf99 /src/poezio.py
parent964e84e11b0fe0a637fdc11450db9fdc2f85045b (diff)
downloadpoezio-fe070163228fba339445483883a05d0178f321cd.tar.gz
poezio-fe070163228fba339445483883a05d0178f321cd.tar.bz2
poezio-fe070163228fba339445483883a05d0178f321cd.tar.xz
poezio-fe070163228fba339445483883a05d0178f321cd.zip
Do not instantiate the Config at module load
delayed execution is cleaner and less error-prone
Diffstat (limited to 'src/poezio.py')
-rw-r--r--src/poezio.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/poezio.py b/src/poezio.py
index 7218cf13..99831896 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -12,22 +12,32 @@ Starting point of poezio. Launches both the Connection and Gui
import sys
import os
-
import signal
-import logging.config
+import logging
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
-from config import options
import singleton
-import core
-
-log = logging.getLogger('')
def main():
"""
Enter point
"""
+ import config
+ config_path = config.check_create_config_dir()
+ config.run_cmdline_args(config_path)
+ config.create_global_config()
+ config.check_create_log_dir()
+ config.setup_logging()
+ config.post_logging_setup()
+
+ from config import options
+
+
+ import core
+
+ log = logging.getLogger('')
+
signal.signal(signal.SIGINT, signal.SIG_IGN) # ignore ctrl-c
cocore = singleton.Singleton(core.Core)
signal.signal(signal.SIGUSR1, cocore.sigusr_handler) # reload the config