This repository has been archived on 2024-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
caylon/main.py
2022-07-30 14:58:49 -04:00

17 lines
481 B
Python

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:
asyncio.sleep(1)