# HG changeset patch # User Thierry Florac # Date 1444232530 -7200 # Node ID d9dc2f58c72b042a7595563e24a1701d02540518 # Parent 67596b00650c89498247c7bb5a1c2683623dfe8d Updated venusian category diff -r 67596b00650c -r d9dc2f58c72b src/pyams_template/template.py --- a/src/pyams_template/template.py Wed Jun 17 10:00:55 2015 +0200 +++ b/src/pyams_template/template.py Wed Oct 07 17:42:10 2015 +0200 @@ -115,7 +115,7 @@ class template_config(object): - """Class decorator used to declare a template""" + """Class decorator used to declare a view template""" venusian = venusian # for testing injection @@ -145,7 +145,7 @@ (ob, settings.get('layer', IRequest)), provides, settings.get('name', '')) - info = self.venusian.attach(wrapped, callback, category='pyams_pagelet') + info = self.venusian.attach(wrapped, callback, category='pyams_template') if info.scope == 'class': # if the decorator was attached to a method in a class, or @@ -159,7 +159,7 @@ class layout_config(object): - """Class decorator used to declare a template""" + """Class decorator used to declare a layout template""" venusian = venusian # for testing injection @@ -173,7 +173,8 @@ settings = self.__dict__.copy() def callback(context, name, ob): - template = os.path.join(os.path.dirname(inspect.getfile(ob)), settings.get('template')) + template = os.path.join(os.path.dirname(inspect.getfile(inspect.getmodule(ob))), + settings.get('template')) if not os.path.isfile(template): raise ConfigurationError("No such file", template) @@ -188,7 +189,7 @@ (ob, settings.get('layer', IRequest)), provides, settings.get('name', '')) - info = self.venusian.attach(wrapped, callback, category='pyams_pagelet') + info = self.venusian.attach(wrapped, callback, category='pyams_template') if info.scope == 'class': # if the decorator was attached to a method in a class, or