summaryrefslogtreecommitdiff
path: root/src/config.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-08 20:15:02 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-08 20:15:02 +0000
commit0adc5f1acf3b06d7b6aa7336684da67b4cefbb9c (patch)
tree81734ee7177133032b45a7e71e63c0cdca932fd2 /src/config.py
parent3ae39c8027cdfe8bead53485a56f1c9b457d82eb (diff)
downloadpoezio-0adc5f1acf3b06d7b6aa7336684da67b4cefbb9c.tar.gz
poezio-0adc5f1acf3b06d7b6aa7336684da67b4cefbb9c.tar.bz2
poezio-0adc5f1acf3b06d7b6aa7336684da67b4cefbb9c.tar.xz
poezio-0adc5f1acf3b06d7b6aa7336684da67b4cefbb9c.zip
fixed #1578
Diffstat (limited to 'src/config.py')
-rw-r--r--src/config.py8
1 files 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)