forked from aegis/pyserveX
fixed pyservectl linter errors and formatting
This commit is contained in:
@@ -5,6 +5,8 @@ pyserve start/stop/restart - Service management commands
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
import click
|
||||
|
||||
|
||||
@@ -18,7 +20,7 @@ import click
|
||||
help="Timeout in seconds for service startup",
|
||||
)
|
||||
@click.pass_obj
|
||||
def start_cmd(ctx, services: tuple, timeout: int):
|
||||
def start_cmd(ctx: Any, services: tuple[str, ...], timeout: int) -> None:
|
||||
"""
|
||||
Start one or more services.
|
||||
|
||||
@@ -43,8 +45,8 @@ def start_cmd(ctx, services: tuple, timeout: int):
|
||||
|
||||
console.print(f"[bold]Starting services: {', '.join(services)}[/bold]")
|
||||
|
||||
async def do_start():
|
||||
results = {}
|
||||
async def do_start() -> Dict[str, bool]:
|
||||
results: Dict[str, bool] = {}
|
||||
for service in services:
|
||||
try:
|
||||
success = await runner.start_service(service, timeout=timeout)
|
||||
@@ -83,7 +85,7 @@ def start_cmd(ctx, services: tuple, timeout: int):
|
||||
help="Force stop (SIGKILL)",
|
||||
)
|
||||
@click.pass_obj
|
||||
def stop_cmd(ctx, services: tuple, timeout: int, force: bool):
|
||||
def stop_cmd(ctx: Any, services: tuple[str, ...], timeout: int, force: bool) -> None:
|
||||
"""
|
||||
Stop one or more services.
|
||||
|
||||
@@ -106,8 +108,8 @@ def stop_cmd(ctx, services: tuple, timeout: int, force: bool):
|
||||
|
||||
console.print(f"[bold]Stopping services: {', '.join(services)}[/bold]")
|
||||
|
||||
async def do_stop():
|
||||
results = {}
|
||||
async def do_stop() -> Dict[str, bool]:
|
||||
results: Dict[str, bool] = {}
|
||||
for service in services:
|
||||
try:
|
||||
success = await runner.stop_service(service, timeout=timeout, force=force)
|
||||
@@ -140,7 +142,7 @@ def stop_cmd(ctx, services: tuple, timeout: int, force: bool):
|
||||
help="Timeout in seconds for restart",
|
||||
)
|
||||
@click.pass_obj
|
||||
def restart_cmd(ctx, services: tuple, timeout: int):
|
||||
def restart_cmd(ctx: Any, services: tuple[str, ...], timeout: int) -> None:
|
||||
"""
|
||||
Restart one or more services.
|
||||
|
||||
@@ -165,7 +167,7 @@ def restart_cmd(ctx, services: tuple, timeout: int):
|
||||
|
||||
console.print(f"[bold]Restarting services: {', '.join(services)}[/bold]")
|
||||
|
||||
async def do_restart():
|
||||
async def do_restart() -> Dict[str, bool]:
|
||||
results = {}
|
||||
for service in services:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user