Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/trac/search/__pycache__/ |
Upload File : |
o �k�`< � @ sF d dl Z d dlT G dd� de�Zdd� Zdd� Zd g d dfdd �ZdS )� N)�*c @ s e Zd ZdZdd� Zdd� ZdS )� ISearchSourcezRExtension point interface for adding search sources to the search system. c C � dS )aO Return a list of filters that this search source supports. Each filter must be a `(name, label[, default])` tuple, where `name` is the internal name, `label` is a human-readable name for display and `default` is an optional boolean for determining whether this filter is searchable by default. N� )�reqr r �1/usr/lib/python3/dist-packages/trac/search/api.py�get_search_filters � z ISearchSource.get_search_filtersc C r )a[ Return a list of search results matching each search term in `terms`. The `filters` parameters is a list of the enabled filters, each item being the name of the tuples returned by `get_search_events`. The events returned by this function must be tuples of the form `(href, title, date, author, excerpt).` Nr )r �terms�filtersr r r �get_search_results! r z ISearchSource.get_search_resultsN)�__name__� __module__�__qualname__�__doc__r r r r r r r s r c s� |r|sJ �� fdd�|D �}d� |�}dd� |gt|� � d }g }|D ]}|�d� �|� d gt|� � q&|t|�fS )z�Convert a search query into an SQL WHERE clause and corresponding parameters. The result is returned as an `(sql, params)` tuple. c s g | ] }d |� � � f �qS )z%s %s)�like)�.0�i��dbr r � <listcomp>4 s z!search_to_sql.<locals>.<listcomp>z OR �(z) AND (�)�%)�join�len�extend�like_escape�tuple)r �columnsr �likes�c�sql�args�tr r r � search_to_sql, s $r% c C s dd� | D �S )z4Convert search query terms into regular expressions.c S s&