From a10c56e97688876c00c65932741a7574f96ee1f7 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 19 Jul 2012 19:26:04 +0200 Subject: [PATCH] fixed bug 1023585 (No handlers could be found for logger 'openlp.core.lib') Fixes: https://launchpad.net/bugs/1023585 --- openlp/core/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index 13c344367..7ea737709 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -248,6 +248,13 @@ def main(args=None): # Parse command line options and deal with them. # Use args supplied programatically if possible. (options, args) = parser.parse_args(args) if args else parser.parse_args() + if options.portable: + app_path = AppLocation.get_directory(AppLocation.AppDir) + set_up_logging(os.path.abspath(os.path.join(app_path, u'..', + u'..', u'Other'))) + log.info(u'Running portable') + else: + set_up_logging(AppLocation.get_directory(AppLocation.CacheDir)) qt_args = [] if options.loglevel.lower() in ['d', 'debug']: log.setLevel(logging.DEBUG) @@ -269,10 +276,6 @@ def main(args=None): app.setApplicationName(u'OpenLPPortable') Settings.setDefaultFormat(Settings.IniFormat) # Get location OpenLPPortable.ini - app_path = AppLocation.get_directory(AppLocation.AppDir) - set_up_logging(os.path.abspath(os.path.join(app_path, u'..', - u'..', u'Other'))) - log.info(u'Running portable') portable_settings_file = os.path.abspath(os.path.join(app_path, u'..', u'..', u'Data', u'OpenLP.ini')) # Make this our settings file @@ -289,7 +292,6 @@ def main(args=None): portable_settings.sync() else: app.setApplicationName(u'OpenLP') - set_up_logging(AppLocation.get_directory(AppLocation.CacheDir)) app.setApplicationVersion(get_application_version()[u'version']) # Instance check if not options.testing: