From 7677ce4016d66c3e49885d76c1244708e81c0203 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 28 Feb 2011 10:50:14 +0100 Subject: [PATCH] "weboob-config edit" prompts user to edit one backend, instead of opening ~/.weboob/backends with $EDITOR. --- weboob/applications/weboobcfg/weboobcfg.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/weboob/applications/weboobcfg/weboobcfg.py b/weboob/applications/weboobcfg/weboobcfg.py index d19c3560..032ca5ce 100644 --- a/weboob/applications/weboobcfg/weboobcfg.py +++ b/weboob/applications/weboobcfg/weboobcfg.py @@ -138,14 +138,15 @@ class WeboobCfg(ReplApplication): def do_edit(self, line): """ - edit + edit NAME - Edit configuration file. + Edit a backend """ - if line: - print 'This command takes no argument.' - else: - subprocess.call([os.environ.get('EDITOR', 'vi'), self.weboob.backends_config.confpath]) + try: + self.edit_backend(line) + except KeyError, e: + print >>sys.stderr, 'Error: backend "%s" not found' % line + return 1 def do_backends(self, line): """