File: nullsearch.py

package info (click to toggle)
sphinxcontrib-websupport 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,112 kB
  • sloc: python: 1,351; javascript: 635; makefile: 53; sh: 7; ansic: 1
file content (18 lines) | stat: -rw-r--r-- 511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""The default search adapter, does nothing."""

from __future__ import annotations

from sphinxcontrib.websupport.errors import NullSearchException
from sphinxcontrib.websupport.search import BaseSearch


class NullSearch(BaseSearch):
    """A search adapter that does nothing. Used when no search adapter
    is specified.
    """
    def feed(self, pagename, filename, title, doctree):
        pass

    def query(self, q):
        msg = 'No search adapter specified.'
        raise NullSearchException(msg)