From 61c7898068d88870eb25fc647cf17f8c59e4c289 Mon Sep 17 00:00:00 2001 From: tza Date: Mon, 4 Apr 2022 18:30:38 +0300 Subject: [PATCH] Update plugin_template.py Added hot_reload parameter and __main method --- plugin_template.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugin_template.py b/plugin_template.py index 3659c2c..2c64ecb 100644 --- a/plugin_template.py +++ b/plugin_template.py @@ -4,16 +4,23 @@ class Plugin: # The name of the plugin author author = "Template Author" + # If the plugin should be reloaded from a call to /plugins/reload or a file change + hot_reload = False + # The HTML that will be loaded when selecting the plugin in the list main_view_html = "

Hello World

" + # The HTML that will be used to display a widget in the plugin main page tile_view_html = "" - # A normal method. It can be called from JavaScript using call_plugin_function("method_1", argument1, argument2) - async def method_1(*args): + async def method_1(self, *args): pass # A normal method. It can be called from JavaScript using call_plugin_function("method_2", argument1, argument2) - async def method_2(*args): + async def method_2(self, *args): pass + + # Asyncio-compatible long-running code, executed in a task when the plugin is loaded + async def __main(self): + pass \ No newline at end of file