webapp¶
-
Code.webapp.
get_locale
()[source]¶ Get the locale from the config.
Get the locale specified in the config. This does not need to be called as it is done so automatically by babel.
Returns: - str
The locale.
See also
pyra.locales.get_locale
- Use this function instead.
Examples
>>> get_locale() en
-
Code.webapp.
home
()[source]¶ Serve the webapp home page.
This page is where most of the functionality for Plugger is provided.
Returns: - render_template
The rendered page.
Notes
The following routes trigger this function.
- /
- /home
Examples
>>> home()
-
Code.webapp.
image
(img)[source]¶ Get image from static/images directory.
Returns: - flask.send_from_directory
The image.
Notes
The following routes trigger this function.
- /favicon.ico
Examples
>>> image('favicon.ico')
-
Code.webapp.
log_stream
(plugin_identifier)[source]¶ Serve the plugin logs in plain text.
Collect and format the logs for the specified plugin.
Parameters: - plugin_identifier : str
The reverse domain name of the plugin, e.g. dev.lizardbyte.plugger.
Returns: - Response
The text of the log files.
Notes
The following routes trigger this function.
- /log_stream/
- /log_stream/<plugin name>
Examples
>>> log_stream(plugin_identifier='dev.lizardbyte.plugger')
-
Code.webapp.
logs
(plugin_identifier)[source]¶ Serve the plugin logs.
Collect and format the logs for the specified plugin.
Parameters: - plugin_identifier : str
The reverse domain name of the plugin, e.g. dev.lizardbyte.plugger.
Returns: - render_template
The logs template with the requested information.
Notes
The following routes trigger this function.
- /logs/
- /logs/<plugin name>
Examples
>>> logs(plugin_identifier='dev.lizardbyte.plugger')