From 10febcd3daff0b9d0b939725c2cc87d79b4b11a8 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Mon, 21 Jul 2008 20:18:12 -0400 Subject: [PATCH] cmd_help: fallback to the base method if the plugin provides no help --- yap/yap.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/yap/yap.py b/yap/yap.py index 027e1ed..185baa9 100644 --- a/yap/yap.py +++ b/yap/yap.py @@ -1149,14 +1149,19 @@ commits cannot be made. def cmd_help(self, cmd=None): if cmd is not None: + cmd = "cmd_" + cmd.replace('-', '_') try: - attr = self.__getattribute__("cmd_"+cmd.replace('-', '_')) + attr = self.__getattribute__(cmd) except AttributeError: raise YapError("No such command: %s" % cmd) try: help = attr.long_help except AttributeError: - raise YapError("Sorry, no help for '%s'. Ask Steven." % cmd) + attr = super(Yap, self).__getattribute__(cmd) + try: + help = attr.long_help + except AttributeError: + raise YapError("Sorry, no help for '%s'. Ask Steven." % cmd) print >>sys.stderr, "The '%s' command" % cmd print >>sys.stderr, "\tyap %s %s" % (cmd, attr.__doc__) -- 2.11.4.GIT