.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.infopage Namespace Reference

Classes

class  InfoPage
 
class  InfoPageSet
 

Functions

 __getattr__ (name)
 

Variables

list __all__ = ['InfoPage', 'InfoPageSet']
 
 logger = logging.getLogger('searx.infopage')
 
 _INFO_FOLDER = os.path.abspath(os.path.dirname(__file__))
 
str INFO_PAGES : 'InfoPageSet'
 

Detailed Description

Render SearXNG instance documentation.

Usage in a Flask app route:

.. code:: python

  from searx import infopage

  _INFO_PAGES = infopage.InfoPageSet(infopage.MistletoePage)

  @app.route('/info/<pagename>', methods=['GET'])
  def info(pagename):

      locale = request.preferences.get_value('locale')
      page = _INFO_PAGES.get_page(pagename, locale)

Function Documentation

◆ __getattr__()

searx.infopage.__getattr__ ( name)

Definition at line 45 of file __init__.py.

45def __getattr__(name):
46 if name == 'INFO_PAGES':
47 global INFO_PAGES # pylint: disable=global-statement
48 INFO_PAGES = InfoPageSet()
49 return INFO_PAGES
50
51 raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
52
53

Variable Documentation

◆ __all__

list searx.infopage.__all__ = ['InfoPage', 'InfoPageSet']
private

Definition at line 22 of file __init__.py.

◆ _INFO_FOLDER

searx.infopage._INFO_FOLDER = os.path.abspath(os.path.dirname(__file__))
protected

Definition at line 41 of file __init__.py.

◆ INFO_PAGES

str searx.infopage.INFO_PAGES : 'InfoPageSet'

Definition at line 42 of file __init__.py.

◆ logger

searx.infopage.logger = logging.getLogger('searx.infopage')

Definition at line 40 of file __init__.py.