From bfd3f28c6ed71bedeb3ec5987c1342fc0f3340d2 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 2 Mar 2010 22:40:01 +0200 Subject: [PATCH] Create the config directory if it doesn't exist yet, in order to save the log file. --- openlp.pyw | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openlp.pyw b/openlp.pyw index 5c18486b6..3910156ce 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -158,7 +158,10 @@ def main(): parser.add_option("-s", "--style", dest="style", help="Set the Qt4 style (passed directly to Qt4).") # Set up logging - filename = os.path.join(get_config_directory(), u'openlp.log') + log_path = get_config_directory() + if not os.path.exists(log_path): + os.makedirs(log_path) + filename = os.path.join(log_path, u'openlp.log') logfile = FileHandler(filename, u'w') logfile.setFormatter(logging.Formatter( u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s'))