60 lines
1.3 KiB
Python
Executable File
60 lines
1.3 KiB
Python
Executable File
#!/usr/bin/python3
|
|
# -*- coding: utf-8 -*-
|
|
# -*- mode: Python -*-
|
|
|
|
|
|
'''
|
|
|
|
v0.0.0
|
|
|
|
AI director
|
|
|
|
Licensed under GNU GPLv3
|
|
|
|
by alban
|
|
|
|
'''
|
|
|
|
from os import path, getcwd
|
|
import sys
|
|
abspath, filename = path.split(path.realpath(__file__ ))
|
|
sys.path.insert(0, path.join(abspath,"lib"))
|
|
import argparse
|
|
import asyncio
|
|
import atexit
|
|
import debugger
|
|
from lib.director import Director
|
|
from lib.my_plugin import MyPlugin
|
|
# from actor_redis import RedisActor
|
|
# from sensor_redis import RedisSensor
|
|
# from planner_dummy import DummyPlanner
|
|
# from planner_duration import DurationPlanner
|
|
# from planner_scheduler import SchedulerPlanner
|
|
from lib.planner_content import ContentPlanner
|
|
|
|
debugger.init()
|
|
|
|
def exit_handler():
|
|
print('\n\nLaunch resources cleanup before exit.\n\n')
|
|
debugger.instance.cleanup()
|
|
|
|
|
|
atexit.register(exit_handler)
|
|
|
|
argsparser = argparse.ArgumentParser(description="AI Director main script")
|
|
argsparser.add_argument("--tags","-t", nargs='+', help="Default Debug tags", default="default")
|
|
args = argsparser.parse_args()
|
|
|
|
async def main():
|
|
director = Director(debug_tags=args.tags)
|
|
director.add_plugin(MyPlugin())
|
|
# director.add_plugin(audioPlugin())
|
|
server = await debugger.instance.server()
|
|
async with server:
|
|
await asyncio.gather(
|
|
server.serve_forever(),
|
|
director.run()
|
|
)
|
|
|
|
asyncio.run(main())
|