#830: Widget.template does not allow to omit package name
---------------------+------------------------------------------------------
Reporter: max | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 1.0b1
Component: Widgets | Version: 0.9a5
Severity: normal | Keywords:
---------------------+------------------------------------------------------
Widgets.template does not allow to omit package name, unlike
turbogears.expose() function. This inconsistency is confusing to the user
and can be seen as a bug.
Attempt to omit package name, like Widget(template=".templates.something")
gives the following traceback:
{{{
Module turbokid.kidsupport:68 in load_template
if not self.options.get("kid.precompiled", False):
tfile = pkg_resources.resource_filename(package,
"%s.kid" %
basename)
ct = self.compiled_templates
if sys.modules.has_key(classname) and
ct.has_key(classname):>> "%s.kid" % basename)
Module pkg_resources:799 in resource_filename
def resource_filename(self, package_or_requirement, resource_name):
"""Return a true filesystem path for specified resource"""
return
get_provider(package_or_requirement).get_resource_filename(
self, resource_name
)>> return
get_provider(package_or_requirement).get_resource_filename(
Module pkg_resources:119 in get_provider
<< module = sys.modules[moduleOrReq]
except KeyError:
__import__(moduleOrReq)
module = sys.modules[moduleOrReq]
loader = getattr(module, '__loader__', None)>>
__import__(moduleOrReq)
exceptions.ValueError: ('Empty module name', <function _wrapper at
0x0180EFB0>)
}}}
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/830>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---