Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import asyncio
- from .infrastructure.services.result import Result
- from .infrastructure.database.create_database import Database
- from .infrastructure.services.helpers import Helpers
- from rich.progress import Progress
- async def start_program():
- helpers = Helpers()
- database = Database()
- with Progress() as progress:
- task = progress.add_task("Checking For Setup Files", total=100)
- setup_file_check = await helpers.check_infrastructure_setup(progress)
- if not setup_file_check.is_success:
- return Result.fail(setup_file_check.message)
- task2 = progress.add_task("Checking For Database Files", total=100)
- database_file_check = database.check_for_db_file(progress)
- if not database_file_check.is_success:
- return Result.fail(database_file_check.message)
- task3 = progress.add_task("Checking For Existing Users", total=100)
- # database code here
- while not progress.finished:
- progress.update(task, advance=33)
- progress.update(task2, advance=33)
- progress.update(task3, advance=34)
- time.sleep(0.02)
- print(setup_file_check.message)
- print(database_file_check.message)
- start_program()
Advertisement
Add Comment
Please, Sign In to add comment