Ticket #3000 (closed defect: fixed)

Opened 5 years ago

Last modified 7 months ago

Search fails when the Wiki _and_ Doxygen has results for a keyword

Reported by: mgerth@igd.fraunhofer.de Assigned to: cboos
Priority: normal Component: DoxygenPlugin
Severity: normal Keywords: doxygen search datetime
Cc: Trac Release: 0.11

Description

The problem is a "datetime.datetime <-> int comparision error" because:

1. The default date-format of the ISearchSource is datetime

2. DoxygenPlugin returns the filedate (ctime) as int.

3. Trac compares both time-types to sort them, but fails because type datetime can not be compared with type int.

Here are the patch instructions for doxygentrac.py using the trac function to_datetime:

...
from trac.util.datefmt import to_timestamp, to_datetime, utc
...
def get_search_results(self, req, keywords, filters):
...
      if os.path.isdir(path):
                index = os.path.join(path, 'search.idx')
                if os.path.exists(index):
>>>>                creation = to_datetime(os.path.getctime(index))     <<<< 
                    for result in  self._search_in_documentation(doc, keywords):
                        result['url'] =  req.href.doxygen(doc) + '/' \
                          
...
 if os.path.exists(index):
>>>>                creation = to_datetime(os.path.getctime(index))  <<<< 
                for result in self._search_in_documentation('', keywords):
             

Attachments

Change History

05/08/08 15:40:08 changed by Blackhex

  • owner changed from Blackhex to cboos.

Yes, it's relict form 0.10 branch since none is really maintaining this plugin.

12/03/08 20:51:37 changed by giel

This fix doesn't work for me. doxygentrac-typeerror-comparison-datetime-float-fix.2.patch from #3079 works however (is a combination of my own first attempt at fixing and this one).

10/21/12 23:55:32 changed by rjollos

  • status changed from new to closed.
  • resolution set to fixed.

This was fixed in [5596].


Add/Change #3000 (Search fails when the Wiki _and_ Doxygen has results for a keyword)




Change Properties
Action