Modify

Opened 2 years ago

Last modified 2 years ago

#10219 new defect

[patch] bring searchattachments plugin to a working state

Reported by: jholg Owned by: rjollos
Priority: normal Component: SearchAttachmentsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

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.

Attachments (2)

searchattachmentsplugin.diff (43.7 KB) - added by jholg 2 years ago.
hg diff patch for searchattachments plugin
searchattachmentsplugin.tgz (20.6 KB) - added by jholg 2 years ago.

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by jholg

hg diff patch for searchattachments plugin

comment:1 Changed 2 years ago by jholg

My trac.ini section:

[searchattachments]
filter.doc = catdoc "%s" > "%s"
filter.odt = odt2txt "%s" --output="%s"
filter.pdf = pdftotext "%s" "%s"       
filter.ppt = catppt "%s" > "%s"        
filter.xls = /export/opt/swish-e/2.4.7/bin/swish-filter-test -content -quiet "%s" > "%s"                                                                  
seat = /export/python/virtualenvs/trac/bin/trac-seat                                   
swish = /export/opt/swish-e/2.4.7/bin/swish-e    

Your paths may vary.

Changed 2 years ago by jholg

comment:2 Changed 2 years ago by jholg

Attached zipped archive in addition to the patch file. Unfortunately I can't recollect which revision of SearchAttachmentsPlugin this was all based on, but judging from changelog nothing seems to have changed in the official version since I dowloaded it and made my changes.

comment:3 Changed 2 years ago by rjollos

Thanks, I'll look into getting this pulled in this weekend.

Add Comment

Modify Ticket

Action
as new The owner will remain rjollos.
Author


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

 
Note: See TracTickets for help on using tickets.