.. _f-documentationserver: module ``server.documentation_server`` ====================================== .. inheritance-diagram:: pyquickhelper.server.documentation_server Short summary +++++++++++++ module ``pyquickhelper.server.documentation_server`` This file defines a simple local server delivering generating documentation. :githublink:`%|py|6` Classes +++++++ +----------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | class | truncated documentation | +==========================================================================================================+===========================================================================+ | :class:`DocumentationHandler ` | Define a simple handler used by HTTPServer, it just serves local content. | +----------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ | :class:`DocumentationThreadServer ` | defines a thread which holds a web server | +----------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+ Functions +++++++++ +-----------------------------------------------------------------------------------+-------------------------+ | function | truncated documentation | +===================================================================================+=========================+ | :func:`run_doc_server ` | Runs the server. | +-----------------------------------------------------------------------------------+-------------------------+ Properties ++++++++++ +---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | property | truncated documentation | +===================================================================================================+=============================================================================================================================+ | :meth:`daemon ` | A boolean value indicating whether this thread is a daemon thread. This must be set before start() is called, otherwise ... | +---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :meth:`ident ` | Thread identifier of this thread or None if it has not been started. This is a nonzero integer. See the get_ident() ... | +---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :meth:`name ` | A string used for identification purposes only. It has no semantics. Multiple threads may be given the same name. ... | +---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :meth:`native_id ` | Native integral thread ID of this thread, or None if it has not been started. This is a non-negative integer. ... | +---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ Static Methods ++++++++++++++ +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | staticmethod | truncated documentation | +================================================================================================================+============================================================================================================+ | :py:meth:`_print_cache ` | Displays the most requested files. | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | :meth:`add_mapping ` | Adds a mapping associated to a local path to watch. | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | :meth:`execute ` | Locally executes a python script. | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | :meth:`get_from_cache ` | Retrieves a file from the cache if it was cached, it the file was added later than a day, it returns None. | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | :meth:`get_ftype ` | defines the header to send (type of files) based on path | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | :meth:`get_mappings ` | Returns a copy of the mappings. | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | :meth:`html_code_renderer ` | Produces a html code for code. | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | :meth:`process_html_path ` | Processes a :epkg:`HTML` content, replaces path which are relative to the root and not the project. | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | :meth:`update_cache ` | Updates the cache. | +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ Methods +++++++ +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +==============================================================================================================+=================================================================================================================================+ | :py:meth:`__init__ ` | Regular constructor, an instance is created for each request, do not store any data for a longer time than a request. ... | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`do_GET ` | What to do is case of GET request. | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`do_POST ` | What to do is case of POST request. | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`do_redirect ` | Redirection when url is just the website. | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`feed ` | Displays something. | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_file_content ` | Returns the content of a local file. | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`LOG ` | logging function | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`run ` | Runs the server. | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`send_headers ` | defines the header to send (type of files) based on path | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`serve_content ` | Tells what to do based on the path. The function intercepts the path /localfile/, otherwise it calls ``serve_content_web``. ... | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`serve_content_web ` | Functions to overload (executed after serve_content). | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`serve_main_page ` | Displays all the mapping for the default path. | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`shutdown ` | Shuts down the service. | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | :meth:`shutdown ` | Shuts down the server, if it does not work, you can still kill the thread: | +--------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pyquickhelper.server.documentation_server :members: :special-members: __init__ :show-inheritance: