Modify

Opened 5 years ago

Closed 5 years ago

Last modified 2 years ago

#5428 closed defect (fixed)

Template "autoquery_ticket.html" not found

Reported by: manski Owned by: k0s
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 5 years ago by mkc

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 5 years ago by aexl

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 5 years ago by k0s

  • Resolution set to fixed
  • Status changed from new to closed

(In [7228]) fixes #5428

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.