add init to scripts

This commit is contained in:
s.mostryukov 2024-10-01 18:31:38 +03:00
parent 9ccbcbfc8d
commit 010e11b6f1
3 changed files with 5 additions and 2 deletions

3
scripts/__init__.py Normal file
View File

@ -0,0 +1,3 @@
from .check_available_ports import start_check as check_available_ports
__all__ = ["check_available_ports"]

View File

@ -4,7 +4,7 @@ from starlette.responses import HTMLResponse
from starlette.templating import Jinja2Templates from starlette.templating import Jinja2Templates
from config import TEMPLATES_DIR from config import TEMPLATES_DIR
from scripts.сheck_available_ports import start_check from scripts import check_available_ports
router = APIRouter() router = APIRouter()
@ -24,7 +24,7 @@ async def check_ports(request: Request):
@router.get("/start") @router.get("/start")
async def start_check_ports(request: Request, inputText: str): async def start_check_ports(request: Request, inputText: str):
results = start_check(inputText, result_type="text") results = check_available_ports(inputText, result_type="text")
return templates.TemplateResponse( return templates.TemplateResponse(
"body-check_ports.html", "body-check_ports.html",
{ {