From 239c4ddeb37d28f414b4e5d3b0a8ba467954cf8e Mon Sep 17 00:00:00 2001 From: Christophe Benz Date: Thu, 8 Apr 2010 16:07:31 +0200 Subject: [PATCH] save default frontend config --- weboob/tools/config/yamlconfig.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weboob/tools/config/yamlconfig.py b/weboob/tools/config/yamlconfig.py index 8b70f4ee..180a035a 100644 --- a/weboob/tools/config/yamlconfig.py +++ b/weboob/tools/config/yamlconfig.py @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. from __future__ import with_statement +import logging import yaml from .iconfig import IConfig, ConfigError @@ -35,8 +36,10 @@ class YamlConfig(IConfig): try: with open(self.path, 'r') as f: self.values = yaml.load(f) + logging.debug(u'Frontend configuration file loaded: %s.' % self.path) except IOError: - pass + self.save() + logging.debug(u'Frontend configuration file created with default values: %s. Please customize it.' % self.path) if self.values is None: self.values = {}