diff --git a/lib/galaxy/util/template.py b/lib/galaxy/util/template.py index 8e50f8e34d9..ef62853a781 100644 --- a/lib/galaxy/util/template.py +++ b/lib/galaxy/util/template.py @@ -1,7 +1,16 @@ +"""Entry point for the usage of Cheetah templating within Galaxy.""" from Cheetah.Template import Template def fill_template( template_text, context=None, **kwargs ): + """Fill a cheetah template out for specified context. + + If template_text is None, an exception will be thrown, if context + is None (the default) - keyword arguments to this function will be used + as the context. + """ + if template_text is None: + raise TypeError("Template text specified as None to fill_template.") if not context: context = kwargs return str( Template( source=template_text, searchList=[context] ) )