Opened 3 years ago
Last modified 8 months ago
#13321 new defect
SpamFilter plugin still using ITemplateStreamFilter
| Reported by: | Owned by: | Dirk Stöcker | |
|---|---|---|---|
| Priority: | normal | Milestone: | plugin - spam-filter |
| Component: | plugin/spamfilter | Version: | |
| Severity: | normal | Keywords: | bitesized |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
The SpamFilter plugin is still using the deprecated ITemplateStreamFilter API and so won't work with trac 1.5.x:
running build_ext
Traceback (most recent call last):
File "setup.py", line 95, in <module>
**extra
File "/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 229, in run
self.run_tests()
File "/usr/lib/python2.7/site-packages/setuptools/command/test.py", line 251, in run_tests
exit=False,
File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__
self.parseArgs(argv)
File "/usr/lib64/python2.7/unittest/main.py", line 149, in parseArgs
self.createTests()
File "/usr/lib64/python2.7/unittest/main.py", line 158, in createTests
self.module)
File "/usr/lib64/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/usr/lib64/python2.7/unittest/loader.py", line 91, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "/builddir/build/BUILD/TracSpamFilter-1.5.0dev-r17344/tracspamfilter/__init__.py", line 17, in <module>
from tracspamfilter.filtersystem import *
File "/builddir/build/BUILD/TracSpamFilter-1.5.0dev-r17344/tracspamfilter/filtersystem.py", line 37, in <module>
from tracspamfilter.filters.trapfield import TrapFieldFilterStrategy
File "/builddir/build/BUILD/TracSpamFilter-1.5.0dev-r17344/tracspamfilter/filters/trapfield.py", line 19, in <module>
from trac.web.api import ITemplateStreamFilter
ImportError: cannot import name ITemplateStreamFilter
Fedora Linux 33 (due for release in October) will have trac 1.5.1 or later so the SpamFilter plugin won't be able to work there as things stand.
Attachments (2)
Change History (6)
comment:1 by , 3 years ago
| Keywords: | bitesized added |
|---|
follow-up: 3 comment:2 by , 8 months ago
by , 8 months ago
| Attachment: | t13321.diff added |
|---|
by , 8 months ago
| Attachment: | t13321-preprocess.diff added |
|---|
comment:3 by , 8 months ago
Replying to Jun Omae:
Proposed changes in t13321.diff using Jinja2 extension API to inject trap fields before
<div class="buttons">.
Reconsidering, it is simple using Extension.preprocess() rather than Extension.filter_stream(): t13321-preprocess.diff.
Also, the templates in the plugin should be ported from Genshi template to Jinja2 template in order to make compatible with Trac 1.5.x.



Proposed changes in t13321.diff using Jinja2 extension API to inject trap fields before
<div class="buttons">. IMO, I don't consider that is bitesized….