dev #19

Merged
profitroll merged 98 commits from dev into master 2023-04-24 13:48:22 +03:00
Showing only changes of commit 9bf4663b9e - Show all commits

View File

@ -26,7 +26,7 @@ async def cli_create_user() -> None:
email = input(f"Choose email for user '{username}': ").strip()
password = input(f"Choose password for user '{username}': ").strip()
try:
result = await create_user(username, email, password)
result_1 = await create_user(username, email, password)
# asyncio.run(create_user(username, email, password))
configSet("username", username, "posting", "api")
configSet("password", password, "posting", "api")
@ -41,6 +41,7 @@ async def cli_create_user() -> None:
print("You're done!", flush=True)
await http_session.close()
exit()
return None
async def cli_create_album() -> None:
@ -51,7 +52,7 @@ async def cli_create_album() -> None:
name = input("Choose a name for your album: ").strip()
title = input(f"Choose a title for album '{name}': ").strip()
try:
result = await create_album(name, title)
result_2 = await create_album(name, title)
# asyncio.run(create_album(name, title))
configSet("album", name, "posting", "api")
except Exception as exp:
@ -61,6 +62,7 @@ async def cli_create_album() -> None:
print("You're done!", flush=True)
await http_session.close()
exit()
return None
if args.create_user or args.create_album:
@ -68,10 +70,9 @@ if args.create_user or args.create_album:
tasks = []
if args.create_user:
tasks.append(loop.create_task(cli_create_user()))
loop.run_until_complete(asyncio.wait([loop.create_task(cli_create_user())]))
if args.create_album:
tasks.append(loop.create_task(cli_create_album()))
loop.run_until_complete(asyncio.wait([loop.create_task(cli_create_album())]))
loop.run_until_complete(asyncio.wait(tasks))
loop.close()