aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/pluginapi.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-01-30 13:22:06 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-01-30 13:22:19 -0600
commit08f3966d543386ec2a8696edd40148b43d474e27 (patch)
tree9cd50e40d53bf1a74877691918a9f63ca1d7aa35 /mediagoblin/tools/pluginapi.py
parent46da25827faa4426b83ebc0ac3c522bcdf2758be (diff)
downloadmediagoblin-08f3966d543386ec2a8696edd40148b43d474e27.tar.lz
mediagoblin-08f3966d543386ec2a8696edd40148b43d474e27.tar.xz
mediagoblin-08f3966d543386ec2a8696edd40148b43d474e27.zip
Moved the docstring for the plugin template stuff from the class to module method
Diffstat (limited to 'mediagoblin/tools/pluginapi.py')
-rw-r--r--mediagoblin/tools/pluginapi.py32
1 files 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)