2022-05-09 17:17:53 +00:00
|
|
|
import os
|
|
|
|
|
2022-04-03 18:43:50 +00:00
|
|
|
class Plugin:
|
2022-05-09 17:17:53 +00:00
|
|
|
async def whoami(self, *args):
|
|
|
|
return os.getuid()
|
|
|
|
|
2022-04-03 18:43:50 +00:00
|
|
|
# A normal method. It can be called from JavaScript using call_plugin_function("method_1", argument1, argument2)
|
2022-04-04 15:30:38 +00:00
|
|
|
async def method_1(self, *args):
|
2022-04-03 18:43:50 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
# A normal method. It can be called from JavaScript using call_plugin_function("method_2", argument1, argument2)
|
2022-04-04 15:30:38 +00:00
|
|
|
async def method_2(self, *args):
|
2022-04-03 18:43:50 +00:00
|
|
|
pass
|
2022-04-04 15:30:38 +00:00
|
|
|
|
|
|
|
# Asyncio-compatible long-running code, executed in a task when the plugin is loaded
|
2022-04-12 22:31:39 +00:00
|
|
|
async def _main(self):
|
2022-05-09 17:17:53 +00:00
|
|
|
pass
|