[patch] bring searchattachments plugin to a working state
|Reported by:||jholg||Owned by:|
SearchAttachmentsPlugin didn't quite work for me in several aspects so I applied some fixes to it. This has been a while and I always forgot to upload the corresponding patch, so here it is now.
Changes that I made (excerpt from my mercurial local repo changelog):
$ hg log -v|egrep -v "user" changeset: 8:e7c0cbbd158f tag: tip date: Thu Feb 18 17:02:32 2010 +0100 files: 0.11/searchattachments/searchattachments.py description: more helpful log message if no index files found (means no attachments) changeset: 7:cc617212dd70 date: Thu Feb 18 16:30:19 2010 +0100 files: 0.11/searchattachments/searchattachments.py description: fixed unicode issue changeset: 6:d0afeb0b8a4b date: Thu Feb 11 11:25:20 2010 +0100 files: 0.11/searchattachments/searchattachments.py description: fixed options changeset: 5:bb5fdc6dc688 date: Wed Feb 10 15:16:59 2010 +0100 files: 0.11/searchattachments/searchattachments.py description: Many changes, including reformatting and saner excerpt extraction, with options to switch off excerpts and for limiting excerpt search and excerpt result length. changeset: 4:49a9ec1eb7a9 date: Tue Feb 09 15:05:44 2010 +0100 files: 0.11/searchattachments/searchattachments.py description: reformat for better style-guide conformity changeset: 3:7ad1c267ebf4 date: Wed Dec 30 15:32:39 2009 +0100 files: 0.11/searchattachments/searchattachments.py 0.11/trac-seat description: Fixed indentation using reindent.py, use spaces now instead of tabs. trac-seat now indexes txt files, too. Force foreground job for attachment deletions to not get inconsistent indexing in case of 'replace attachm. with the same name' operations. Excerpt handling now works for files that do not contain any newlines before a search keyword. changeset: 2:bd327f343d0c date: Mon Dec 28 14:39:05 2009 +0100 files: 0.11/trac-seat description: removed obsolete commented-out stuff changeset: 1:4540952d9e13 date: Wed Dec 23 17:07:23 2009 +0100 files: 0.11/searchattachments/searchattachments.py 0.11/setup.py 0.11/trac-seat description: 1st working version. Changes: * trac-seat added as script to setup.py * trac-seat fixed: Option parsing now working, use trac Configuration class for ini file access (otherwise, inherit mechanisms will not work), some fixes regarding reading the relevant config sections * change config section name to use 'searchattachments' consistently * fixed seat and swish options * use absolute urls in results to support multi-project (tracforge) setups; absolute urls are constructed from the request href changeset: 0:2b345fa0a9a3 date: Wed Dec 23 14:19:46 2009 +0100 files: 0.10/README 0.10/searchattachments/__init__.py 0.10/searchattachments/searchattachments.py 0.10/setup.py 0.10/trac-seat 0.11/README 0.11/searchattachments/__init__.py 0.11/searchattachments/searchattachments.py 0.11/setup.py 0.11/trac-seat description: initial checkin
I've been running this ever since in a production trac environment and it works quite nicely.