As a result of re-factoring work described here:
http://groups.google.com/group/turbogears/browse_frm/thread/3f5343f102949b86
The layout of my package has changed; the module is one layer deeper
than it was before, because of the new namespace directory.
I noticed static content serving wasn't working, and narrowed it down
to these lines from config.py (TG v1.0.8):
lastdot = modulename.rfind('.')
firstdot = modulename.find('.')
packagename = modulename[:lastdot]
top_level_package = modulename[:firstdot]
...
top_level_dir = os.path.normpath
(pkg_resources.resource_filename(
top_level_package, ''))
If modulename is of the form 'module.config', it all works. If
modulename is of the form 'namespace.module.config', top_level_dir is
set to a completely wrong value based off the namespace, not the whole
package.
I think changing the last line to:
top_level_dir = os.path.normpath
(pkg_resources.resource_filename(
packagename, ''))
Should handle namespaced and non-namespaced packages alike - should I
raise a ticket?