Modify

Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#5428 closed defect (fixed)

Template "autoquery_ticket.html" not found

Reported by: Sebastian Krysmanski Owned by: Jeff Hammel
Priority: high Component: AutoQueryPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description

I've just installed this plugin via easy_install and it doesn't work as the directory templates isn't included in the egg. Trac prints the error:

Template "autoquery_ticket.html" not found

The problem can be solved by unpacking the egg and downloading the template file manually.

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by Michael Ching

setup.py can be patched to include the templates directory.

--- setup.py.orig       2009-07-07 12:03:49.000000000 -0500
+++ setup.py    2009-07-07 12:04:11.000000000 -0500
@@ -10,7 +10,8 @@
       url='http://trac-hacks.org/wiki/AutoQueryPlugin',
       keywords='trac plugin',
       license="GPL",
-      packages=find_packages(exclude=['ez_setup', 'examples', 'tests*']),
+      packages = ['autoquery'],
+      package_data = { 'autoquery': ['templates/*.html'] },
       include_package_data=True,
       zip_safe=False,
       entry_points = """

comment:2 Changed 7 years ago by äxl

TNX, this patch saved my evening.

here is mi traceback for reference. after applying the patch no errors anymore.

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 339, in send_error
    'text/html')
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 683, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 659, in load_template
    self.templates = TemplateLoader(self.get_all_templates_dirs(),
  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 406, in get_all_templates_dirs
    dirs += provider.get_templates_dirs()
  File "build/bdist.linux-x86_64/egg/autoquery/autoquery.py", line 37, in get_templates_dirs
    return [resource_filename(__name__, 'templates')]
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 882, in resource_filename
    self, resource_name
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1352, in get_resource_filename
    return self._extract_resource(manager, zip_path)
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1363, in _extract_resource
    zip_stat = self.zipinfo[zip_path]
KeyError: 'autoquery/templates'

comment:3 Changed 7 years ago by Jeff Hammel

Resolution: fixed
Status: newclosed

(In [7228]) fixes #5428

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jeff Hammel.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.