Fix doctests for pyflakes
I'm pretty sure those doctests will not work if ran, but they serve as useful documentation.
This commit is contained in:
parent
216ba19e6a
commit
4b38dcbbed
1 changed files with 7 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ from threading import RLock
|
||||||
from copy import copy
|
from copy import copy
|
||||||
|
|
||||||
from weboob.capabilities.base import CapBaseObject, FieldNotFound, \
|
from weboob.capabilities.base import CapBaseObject, FieldNotFound, \
|
||||||
IBaseCap, NotLoaded, NotAvailable
|
IBaseCap, NotLoaded, NotAvailable
|
||||||
from weboob.tools.misc import iter_fields
|
from weboob.tools.misc import iter_fields
|
||||||
from weboob.tools.log import getLogger
|
from weboob.tools.log import getLogger
|
||||||
from weboob.tools.value import ValuesDict
|
from weboob.tools.value import ValuesDict
|
||||||
|
|
@ -54,6 +54,8 @@ class BackendStorage(object):
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
>>> from weboob.tools.storage import StandardStorage
|
||||||
|
>>> backend = BackendStorage('blah', StandardStorage('/tmp/cfg'))
|
||||||
>>> backend.storage.set('config', 'nb_of_threads', 10)
|
>>> backend.storage.set('config', 'nb_of_threads', 10)
|
||||||
>>>
|
>>>
|
||||||
|
|
||||||
|
|
@ -77,6 +79,8 @@ class BackendStorage(object):
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
>>> from weboob.tools.storage import StandardStorage
|
||||||
|
>>> backend = BackendStorage('blah', StandardStorage('/tmp/cfg'))
|
||||||
>>> backend.storage.get('config', 'nb_of_threads')
|
>>> backend.storage.get('config', 'nb_of_threads')
|
||||||
10
|
10
|
||||||
>>> backend.storage.get('config', 'unexistant', 'path', default='lol')
|
>>> backend.storage.get('config', 'unexistant', 'path', default='lol')
|
||||||
|
|
@ -161,7 +165,8 @@ class BackendConfig(ValuesDict):
|
||||||
field.load(cfg.instname, value, cfg.weboob.callbacks)
|
field.load(cfg.instname, value, cfg.weboob.callbacks)
|
||||||
except ValueError, v:
|
except ValueError, v:
|
||||||
if not nofail:
|
if not nofail:
|
||||||
raise BaseBackend.ConfigError('Backend(%s): Configuration error for field "%s": %s' % (cfg.instname, name, v))
|
raise BaseBackend.ConfigError(
|
||||||
|
'Backend(%s): Configuration error for field "%s": %s' % (cfg.instname, name, v))
|
||||||
|
|
||||||
cfg[name] = field
|
cfg[name] = field
|
||||||
return cfg
|
return cfg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue