https://t.me/RX1948
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/trac/search/__pycache__/api.cpython-310.pyc
o

�k�`<�@sFddlZddlTGdd�de�Zdd�Zdd�Zd	gd
dfdd
�ZdS)�N)�*c@s eZdZdZdd�Zdd�ZdS)�
ISearchSourcezRExtension point interface for adding search sources to the search
    system.
    cC�dS)aOReturn 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�)�reqrr�1/usr/lib/python3/dist-packages/trac/search/api.py�get_search_filters�z ISearchSource.get_search_filterscCr)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�filtersrrr�get_search_results!r	z ISearchSource.get_search_resultsN)�__name__�
__module__�__qualname__�__doc__rrrrrrrs	rcs�|r|sJ��fdd�|D�}d�|�}dd�|gt|��d}g}|D]}|�d��|�dgt|��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.
    csg|]
}d|���f�qS)z%s %s)�like)�.0�i��dbrr�
<listcomp>4sz!search_to_sql.<locals>.<listcomp>z OR �(z) AND (�)�%)�join�len�extend�like_escape�tuple)r�columnsr
�likes�c�sql�args�trrr�
search_to_sql,s
$r%cCsdd�|D�S)z4Convert search query terms into regular expressions.cSs&g|]}t�t�|�tjtjB��qSr)�re�compile�escape�
IGNORECASE�UNICODE)r�termrrrr?s�z%search_to_regexps.<locals>.<listcomp>r)r
rrr�search_to_regexps=s�r,����<cCs�|sd}|��}d}|D]}|�|���}d|kr|ks$n|dkr&|}qd}||krMdD]}	|�|	|||d�}
|
dkrF|
d7}
nq/||}
|
}|dkrSd}||||�}||krcd|}|t|�|kro|d7}|S)Nr-���r)�.�:�;�=�z... z ...)�lower�findr)�text�keywords�maxlen�fuzz�text_low�beg�kr�excerpt_beg�sep�eb�msgrrr�shorten_resultCs6��rC)r&�	trac.core�	Interfacerr%r,rCrrrr�<module>s


https://t.me/RX1948 - 2025