From 08f3966d543386ec2a8696edd40148b43d474e27 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 30 Jan 2013 13:22:06 -0600 Subject: [PATCH] Moved the docstring for the plugin template stuff from the class to module method --- mediagoblin/tools/pluginapi.py | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/mediagoblin/tools/pluginapi.py b/mediagoblin/tools/pluginapi.py index 99b13ac7..1f28690e 100644 --- a/mediagoblin/tools/pluginapi.py +++ b/mediagoblin/tools/pluginapi.py @@ -135,19 +135,6 @@ class PluginManager(object): return tuple(self.routes) def register_template_hooks(self, template_hooks): - """ - Register a dict of template hooks. - - Takes template_hooks as an argument, which is a dictionary of - template hook names/keys to the templates they should provide. - (The value can either be a single template path or an iterable - of paths.) - - Example: - {"media_sidebar": "/plugin/sidemess/mess_up_the_side.html", - "media_descriptionbox": ["/plugin/sidemess/even_more_mess.html", - "/plugin/sidemess/so_much_mess.html"]} - """ for hook, templates in template_hooks.items(): if isinstance(templates, (list, tuple)): self.template_hooks.setdefault(hook, []).extend(list(templates)) @@ -237,8 +224,27 @@ def get_config(key): def register_template_hooks(template_hooks): + """ + Register a dict of template hooks. + + Takes template_hooks as an argument, which is a dictionary of + template hook names/keys to the templates they should provide. + (The value can either be a single template path or an iterable + of paths.) + + Example: + {"media_sidebar": "/plugin/sidemess/mess_up_the_side.html", + "media_descriptionbox": ["/plugin/sidemess/even_more_mess.html", + "/plugin/sidemess/so_much_mess.html"]} + """ PluginManager().register_template_hooks(template_hooks) def get_hook_templates(hook_name): + """ + Get a list of hook templates for this hook_name. + + Returns: + A list of strings representing template paths. + """ return PluginManager().get_template_hooks(hook_name) -- 2.25.1