mirror of
				https://github.com/ijaric/voice_assistant.git
				synced 2025-10-31 18:23:25 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			38 lines
		
	
	
		
			757 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			757 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| 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()
 |