len + print
This commit is contained in:
parent
55699412ea
commit
4bf547aefd
12
hlna.py
12
hlna.py
@ -69,7 +69,7 @@ def hlna():
|
||||
@click.argument('g', nargs=1)
|
||||
@click.option('-d',required=True , help="Путь до zip архива")
|
||||
def restore(g, d):
|
||||
"Получение пути к файлам внутри архива"
|
||||
"""Получение пути к файлам внутри архива"""
|
||||
with zipfile.ZipFile(d, 'r') as zip_file:
|
||||
files = zip_file.namelist()
|
||||
"Извлечение файлов"
|
||||
@ -86,7 +86,7 @@ def restore(g, d):
|
||||
def backup(g):
|
||||
if g == "ark" or g == "ark_test":
|
||||
source = [f"{dir_config}"]
|
||||
#backup_path = input("Введите конечный путь для бэкапа, по умолчанию ******")
|
||||
# backup_path = input("Введите конечный путь для бэкапа, по умолчанию ******")
|
||||
backup_path = f"{dir_server_ark}Backups" if g=="ark" else f"{dir_server_ark}Backups/test_backup"
|
||||
if not backup_path:
|
||||
backup_path = f"{dir_server_ark}Backups"
|
||||
@ -197,10 +197,12 @@ def print_line(*text, flag="", sep=" ", end="\n"):
|
||||
color = colorama.Fore.CYAN
|
||||
else:
|
||||
color = colorama.Fore.WHITE
|
||||
len_text = len(*text)+2
|
||||
print(colorama.Fore.LIGHTGREEN_EX + "." * len_text)
|
||||
len_text = str(*text)
|
||||
len_text = len_text.split("\n")
|
||||
max_length = max(len(string) for string in len_text)+2
|
||||
print(colorama.Fore.LIGHTGREEN_EX + "." * max_length)
|
||||
print(color, *text, sep=sep, end=end)
|
||||
print(colorama.Fore.LIGHTGREEN_EX + "." * len_text + colorama.Style.RESET_ALL)
|
||||
print(colorama.Fore.LIGHTGREEN_EX + "." * max_length + colorama.Style.RESET_ALL)
|
||||
|
||||
|
||||
def check_int(number=""):
|
||||
|
Loading…
Reference in New Issue
Block a user