2022-07-24 21:17:41 +01:00
|
|
|
import pathlib
|
|
|
|
import subprocess
|
|
|
|
import asyncio
|
|
|
|
import os
|
|
|
|
|
|
|
|
HOME_DIR = str(pathlib.Path(os.getcwd()).parent.parent.resolve())
|
|
|
|
PARENT_DIR = str(pathlib.Path(__file__).parent.resolve())
|
|
|
|
|
|
|
|
class Plugin:
|
|
|
|
backend_proc = None
|
|
|
|
# Asyncio-compatible long-running code, executed in a task when the plugin is loaded
|
|
|
|
async def _main(self):
|
|
|
|
# startup
|
|
|
|
self.backend_proc = subprocess.Popen([PARENT_DIR + "/bin/backend"])
|
|
|
|
while True:
|
2022-07-29 00:56:09 +01:00
|
|
|
await asyncio.sleep(1)
|