From 83887812a28137c986ef179b034e24d2aa33e3f4 Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Thu, 15 Jan 2015 18:32:44 +0100
Subject: [PATCH] Fixing bug when launching the client for the first time

---
 src/cutecoin/core/app.py    | 4 ----
 src/cutecoin/core/config.py | 6 +++++-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/cutecoin/core/app.py b/src/cutecoin/core/app.py
index a88292c6..9734fc76 100644
--- a/src/cutecoin/core/app.py
+++ b/src/cutecoin/core/app.py
@@ -66,10 +66,6 @@ class Application(object):
         self.load_cache(account)
 
     def load(self):
-        if not os.path.exists(config.parameters['home']):
-            logging.info("Creating home directory")
-            os.makedirs((config.parameters['home']))
-
         if (os.path.exists(config.parameters['data'])
                 and os.path.isfile(config.parameters['data'])):
             logging.debug("Loading data...")
diff --git a/src/cutecoin/core/config.py b/src/cutecoin/core/config.py
index f03644a2..d921a711 100644
--- a/src/cutecoin/core/config.py
+++ b/src/cutecoin/core/config.py
@@ -7,7 +7,7 @@ Created on 7 févr. 2014
 import logging
 from logging import FileHandler
 from optparse import OptionParser
-from os import environ, path
+from os import environ, path, makedirs
 
 
 if "XDG_CONFIG_HOME" in environ:
@@ -22,6 +22,10 @@ else:
 parameters = {'home': path.join(config_path, 'cutecoin'),
               'data': path.join(config_path, 'cutecoin', 'data')}
 
+if not path.exists(parameters['home']):
+    logging.info("Creating home directory")
+    makedirs((parameters['home']))
+
 
 def parse_arguments(argv):
     parser = OptionParser()
-- 
GitLab