pigeon¶
Subpackages¶
Submodules¶
Package Contents¶
- pigeon.modules¶
- class pigeon.Pigeon(settings=None)¶
The Pigeon class is the main interface used for the user to interact with Pigeon. It houses important decorators for registering views, etc. such as Pigeon.view and Pigeon.error.
Furthermore it facilitates exception-handling, exit-handling, debug_mode application reinitialization through watchdog,
- settings = None¶
- autorun = True¶
- observers = []¶
- classmethod run(auto=False) None ¶
- Parameters:
auto – specifies whether the application has been started automatically due to the atexit call,
if so we will check back whether this
- classmethod restart()¶
Restarts the entire application
- classmethod handle_exception(exception_type, exception, *args, custom_log: pigeon.utils.logger.Log = log, description: str = 'AN EXCEPTION OCCURED') None ¶
- Parameters:
exception_type – Type of exception (unused)
exception – The exception that should be handled
custom_log – Pigeon log that error message corresponding to the exception will be logged in
description – The status message that will be logged to explain or give details about the error
This is a custom exception handler. It facilitates the following:
if an exception occurs before the server has started, the server will not start
exceptions during runtime will be logged and if the CRASH_ON_FAILURE setting is set to True the app will terminate
- classmethod handle_exit(status, force: bool = False) None ¶
- classmethod view(target: str, mimetype: str = '*/*', auth=None) Callable ¶
- classmethod error(code: int) Callable ¶