Commit 98e3da92 authored by Michael Scherer's avatar Michael Scherer Committed by Romain Bignon

add enable and disable command to weboob-config

Signed-off-by: default avatarMichael Scherer <misc@zarb.org>
Signed-off-by: Romain Bignon's avatarRomain Bignon <romain@peerfuse.org>
parent c587ce65
......@@ -55,6 +55,9 @@ Erwan Jahier <Erwan.Jahier@imag.fr>
Laurent Dufréchou <laurent.dufrechou@gmail.com>
* Windows support.
Michael Scherer <misc@zarb.org>
* Contribution on weboob-config.
Romain Garbage <romain.garbage@gmail.com>
* Fixes for FreeBSD.
......
......@@ -144,6 +144,31 @@ class WeboobCfg(ReplApplication):
print >>sys.stderr, 'Backend instance "%s" does not exist' % instance_name
return 1
def _do_toggle(self, name, state):
try:
bname, items = self.weboob.backends_config.get_backend(name)
except KeyError:
print >>sys.stderr, 'Backend instance "%s" does not exist' % name
return 1
self.weboob.backends_config.edit_backend(name, bname, {'_enabled': state})
def do_enable(self, name):
"""
enable NAME
Enable a disabled backend
"""
self._do_toggle(name, 1)
def do_disable(self, name):
"""
disable NAME
Disable a backend
"""
self._do_toggle(name, 0)
def do_edit(self, line):
"""
edit NAME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment