From bd7138b34c9f067250158ee59a3a7e3c1b128bce Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Thu, 12 Aug 2010 10:32:01 +0200 Subject: [PATCH] properly call methods not wrapped by protectDjangoErrPage (ie, dbus) --- pyweb/mucli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyweb/mucli.py b/pyweb/mucli.py index d3fefa0..0aaf850 100755 --- a/pyweb/mucli.py +++ b/pyweb/mucli.py @@ -150,8 +150,10 @@ else: print >> sys.stderr, "Method name: %s" % progargs[0] method = getattr( ctl, progargs[0] ) + bound = True if hasattr( method, "innerfunc" ): method = method.innerfunc + bound = False args = inspect.getargspec( method )[0] @@ -180,7 +182,10 @@ else: if options.verbose: print >> sys.stderr, "Call arguments: %s" % repr(cleanargs) - print method( ctl, *cleanargs ) + if bound: + print method( *cleanargs ) + else: + print method( ctl, *cleanargs ) elif len(args) == 1: print >> sys.stderr, "Method '%s' does not take any arguments." % progargs[0]