mirror of
https://github.com/ijaric/voice_assistant.git
synced 2026-04-06 04:09:38 +00:00
feat: new file structure
This commit is contained in:
0
src/assistant/bin/__init__.py
Normal file
0
src/assistant/bin/__init__.py
Normal file
37
src/assistant/bin/__main__.py
Normal file
37
src/assistant/bin/__main__.py
Normal file
@@ -0,0 +1,37 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
|
||||
import lib.app as app
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def run() -> None:
|
||||
settings = app.Settings()
|
||||
application = app.Application.from_settings(settings)
|
||||
|
||||
try:
|
||||
await application.start()
|
||||
finally:
|
||||
await application.dispose()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
try:
|
||||
asyncio.run(run())
|
||||
exit(os.EX_OK)
|
||||
except SystemExit:
|
||||
exit(os.EX_OK)
|
||||
except app.ApplicationError:
|
||||
exit(os.EX_SOFTWARE)
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Exited with keyboard interruption")
|
||||
exit(os.EX_OK)
|
||||
except BaseException:
|
||||
logger.exception("Unexpected error occurred")
|
||||
exit(os.EX_SOFTWARE)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user