From 0adc5f1acf3b06d7b6aa7336684da67b4cefbb9c Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Thu, 8 Jul 2010 20:15:02 +0000 Subject: fixed #1578 --- src/config.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config.py b/src/config.py index 7d25fde4..d4005852 100644 --- a/src/config.py +++ b/src/config.py @@ -24,7 +24,7 @@ from/to the config file """ from ConfigParser import RawConfigParser, NoOptionError -from os import environ, makedirs +from os import environ, makedirs, path from shutil import copy2 import argparse @@ -117,12 +117,14 @@ if not CONFIG_HOME: CONFIG_PATH = CONFIG_HOME + '/poezio/' try: makedirs(CONFIG_PATH) - copy2('../data/default_config.cfg', CONFIG_PATH+'poezio.cfg') except OSError: pass +if not path.isfile(CONFIG_PATH+'poezio.cfg'): + copy2('../data/default_config.cfg', CONFIG_PATH+'poezio.cfg') + parser = argparse.ArgumentParser(prog="poezio", description='An XMPP ncurses client.') parser.add_argument('-f', '--file', default=CONFIG_PATH+'poezio.cfg', help='the config file you want to use', metavar="FILE") args = parser.parse_args() -print args.file + config = Config(args.file) -- cgit v1.2.3