Opened 14 years ago

Closed 10 years ago

Last modified 10 years ago

#3000 closed defect (fixed)

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

Reported by: mgerth@… Owned by: Christian Boos
Priority: normal Component: DoxygenPlugin
Severity: normal Keywords: doxygen search datetime
Cc: Trac Release: 0.11


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

  1. The default date-format of the ISearchSource is datetime
  1. DoxygenPlugin returns the filedate (ctime) as int.
  1. 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 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 (0)

Change History (3)

comment:1 Changed 14 years ago by Radek Bartoň

Owner: changed from Radek Bartoň to Christian Boos

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

comment:2 Changed 14 years ago by Giel van Schijndel

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).

comment:3 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

This was fixed in [5596].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

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

Note: See TracTickets for help on using tickets.