From 13df4e0bf8a12bedfb7bdf65f71bc3ea337d55cc Mon Sep 17 00:00:00 2001 From: none Date: Sun, 25 Feb 2024 15:45:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B0=D0=B2=D1=82=D0=BE-=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=B4=D0=B0=D1=87=D0=B8=20=D1=81=D0=B0=D0=B9=D1=82=D0=B0?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interface.py | 1 - site_creator.py | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/interface.py b/interface.py index a5b53f6..d630bd8 100644 --- a/interface.py +++ b/interface.py @@ -1,5 +1,4 @@ import streamlit as st -#from streamlit import empty as c from os import walk from time import sleep diff --git a/site_creator.py b/site_creator.py index 69ee5f6..1622d2b 100644 --- a/site_creator.py +++ b/site_creator.py @@ -2,6 +2,7 @@ from os import system, mkdir from db import * from shutil import copyfile, make_archive, rmtree, copytree from tqdm import tqdm +from time import sleep from verify import * from network import * @@ -9,6 +10,7 @@ from network import * print("(1) Создать сайт") print("(2) Обновить сайт") print("(3) Сменить тип") +print("(4) Авто-раздача сайта") print("Enter для просто публикации.") op = input(">> ") @@ -103,6 +105,24 @@ elif op == "3": exit() +elif op == "4": + domain = input("\nДомен сайта: ") + if not os.path.exists(f"mysites/{domain}"): + print("Не существует такого сайта.") + exit() + + print("\nВведите ваш порт сервера (при запуске main.py)") + serv_port = int(input(">> ")) + http_port = client(serv_port, f"is_{domain}") + + print("\nСтарт вечной раздачи...") + while True: + ports = port_check(serv_port) + sleep(1) + for port in tqdm(ports): + client(port, f"publish_{domain}<>{http_port}") + sleep(5) + elif op == "": domain = input("\nДомен сайта: ") if not os.path.exists(f"mysites/{domain}"):