.. _f-simpleservercustom: module ``simple_server.simple_server_custom`` ============================================= .. inheritance-diagram:: pyrsslocal.simple_server.simple_server_custom Short summary +++++++++++++ module ``pyrsslocal.simple_server.simple_server_custom`` This modules contains a class which implements a simple server. :githublink:`%|py|5` Classes +++++++ +--------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +======================================================================================+============================================================================================================================+ | :class:`SimpleHandler ` | Defines a simple handler used by *HTTPServer*. Firefox works better for local files. This class provides the following ... | +--------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | :class:`ThreadServer ` | Defines a thread which holds a web server. | +--------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ Functions +++++++++ +-------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | function | truncated documentation | +=================================================================================================+================================================================================================================+ | :func:`get_path_javascript ` | *pyrsslocal* contains some javascript script, it adds the paths to the paths where content will be looked for. | +-------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------+ | :func:`run_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. ... | +------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ 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:`add_path ` | Adds a local path to the list of path to watch. | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :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:`execute ` | Locally execute a python script. | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`feed ` | Displays something. | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_file_content ` | Returns the content of a local file. The function also looks into folders in ``self.__pathes`` to see if the file ... | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_ftype ` | Defines the header to send (type of files) based on path. | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_javascript_paths ` | Returns all the location where the server should look for a java script. | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`get_pathes ` | Returns a list of local path where to look for a local file. | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`html_code_renderer ` | Produces a :epkg:`html` code for code. | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`LOG ` | To log, it appends various information about the id address... | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`log_message ` | Logs an arbitrary message. Overloads the original method. This is used by all other logging functions. Override ... | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`main_page ` | Returns the main page (case the server is called with no path). | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`private_LOG ` | To log | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`process_scripts ` | Parses a :epkg:`HTML` string, extract script section (only python script for the time being) and returns ... | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :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:`shutdown ` | Shuts down the service from the service itself (not from another thread). For the time being, the function generates ... | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`shutdown ` | Shuts down the server, if it does not work, you can still kill the thread: | +-----------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pyrsslocal.simple_server.simple_server_custom :members: :special-members: __init__ :show-inheritance: