From 9125622328dad71550452068310766fb4c6db2d8 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 11 Apr 2010 20:11:33 +0200 Subject: [PATCH] fix parsing of default values in backend config --- weboob/backend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weboob/backend.py b/weboob/backend.py index 907777f2..781c44f8 100644 --- a/weboob/backend.py +++ b/weboob/backend.py @@ -85,11 +85,11 @@ class Backend(object): raise Backend.ConfigError('Value of "%s" does not match regexp "%s"' % (name, field.regexp)) if not field.default is None: - if isinstance(field.default, bool): + if isinstance(field.default, bool) and not isinstance(value, bool): value = value.lower() in ('1', 'true', 'on', 'yes') - elif isinstance(field.default, int): + elif isinstance(field.default, int) and not isinstance(value, int): value = int(value) - elif isinstance(field.default, float): + elif isinstance(field.default, float) and not isinstance(value, float): value = float(value) self.config[name] = value self.storage = BackendStorage(self.name, storage)