generated from SteamDeckHomebrew/decky-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.py
22 lines (18 loc) · 783 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import logging
logging.basicConfig(filename="/tmp/sharedecky.log",
format='[ShareDeck-y] %(asctime)s %(levelname)s %(message)s',
filemode='w+',
force=True)
logger=logging.getLogger()
logger.setLevel(logging.DEBUG) # can be changed to logging.DEBUG for debugging issues
class Plugin:
# A normal method. It can be called from JavaScript using call_plugin_function("method_1", argument1, argument2)
async def add(self, left, right):
return left + right
async def log(self, content):
logger.info(content)
return content
# Asyncio-compatible long-running code, executed in a task when the plugin is loaded
async def _main(self):
# logger.info("Hello World!")
pass