def methods_for(plugin): return dict([(name, { "path": "/%s/%s/" % (plugin.plugin_name, name), "spec": argspec(method), "interval": method.interval, "human-interval": naturalinterval(method.interval), }) for name, method in plugin.methods.iteritems()])
def run_method(self, method, **args): """Runs a method with some arguments, catching all manner of error conditions and logging them appropriately""" try: return method(**args) except TypeError, e: if "takes" in e.message and "arguments" in e.message: return "%s\nargspec: %s.%s\n" % (traceback.format_exc(), method.plugin.plugin_name, argspec(method)) return traceback.format_exc()
def methods_for(plugin): return dict( [ ( name, { "path": "/%s/%s/" % (plugin.plugin_name, name), "spec": argspec(method), "interval": method.interval, "human-interval": naturalinterval(method.interval), }, ) for name, method in plugin.methods.iteritems() ] )