apppublic/appPublic/asynciorun.py

16 lines
331 B
Python
Raw Normal View History

2023-05-23 09:38:22 +08:00
import asyncio
2023-06-01 02:05:44 +08:00
import sys
from sqlor.dbpools import DBPools
2023-05-23 09:38:22 +08:00
from appPublic.jsonConfig import getConfig
def run(coro):
p = '.'
if len(sys.argv) > 1:
p = sys.argv[1]
config = getConfig(p, {'woridir':p})
DBPools(config.databases)
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(coro())