Renamed gen_password.py into generate_password.py, fixed gen_password command

This commit is contained in:
StNicolay 2022-11-30 16:50:42 +03:00
parent 2d2ed017f1
commit 2a5b594f3f
3 changed files with 11 additions and 5 deletions

View File

@ -2,7 +2,14 @@ import os
from dotenv import load_dotenv from dotenv import load_dotenv
from . import account_checks, account_parsing, bot, cryptography, database, gen_password from . import (
account_checks,
account_parsing,
bot,
cryptography,
database,
generate_password,
)
__all__ = [ __all__ = [
"account_checks", "account_checks",
@ -10,7 +17,7 @@ __all__ = [
"bot", "bot",
"cryptography", "cryptography",
"database", "database",
"gen_password", "generate_password",
] ]

View File

@ -5,7 +5,7 @@ import time
import telebot import telebot
from sqlalchemy.future import Engine from sqlalchemy.future import Engine
from .. import cryptography, database from .. import cryptography, database, generate_password
from ..account_checks import ( from ..account_checks import (
check_account, check_account,
check_account_name, check_account_name,
@ -13,7 +13,6 @@ from ..account_checks import (
check_password, check_password,
) )
from ..account_parsing import accounts_to_json, json_to_accounts from ..account_parsing import accounts_to_json, json_to_accounts
from ..gen_password import gen_password
Message = telebot.types.Message Message = telebot.types.Message
@ -494,7 +493,7 @@ def _import3(
def gen_password(bot: telebot.TeleBot, mes: Message) -> None: def gen_password(bot: telebot.TeleBot, mes: Message) -> None:
_base_handler(bot, mes) _base_handler(bot, mes)
# Generate 10 passwords and put 'em in the backticks # Generate 10 passwords and put 'em in the backticks
passwords = (f"`{gen_password()}`" for _ in range(10)) passwords = (f"`{generate_password.gen_password()}`" for _ in range(10))
text = ( text = (
"Пароли:\n" "Пароли:\n"
+ "\n".join(passwords) + "\n".join(passwords)