Autoformat

This commit is contained in:
hhh
2024-05-27 17:12:21 +03:00
parent 0afca0dd67
commit 918d5af851
25 changed files with 358 additions and 378 deletions

View File

@@ -2,34 +2,34 @@ import os
import click
from dragonion_server.utils.config import db
from dragonion_server.common import console
from dragonion_server.utils.config import db
class ServiceRemoveCommand(click.Command):
def __init__(self):
super().__init__(
name='remove',
name="remove",
callback=self.callback,
params=[
click.Option(
('--name', '-n'),
("--name", "-n"),
required=True,
prompt=True,
type=str,
help='Name of service to write to'
help="Name of service to write to",
)
]
],
)
@staticmethod
def callback(name: str):
try:
del db.services[name]
if os.path.isfile(f'{name}.auth'):
os.remove(f'{name}.auth')
print(f'Removed service {name}')
if os.path.isfile(f"{name}.auth"):
os.remove(f"{name}.auth")
print(f"Removed service {name}")
except KeyError:
print(f'Service "{name}" does not exist in this storage')
except Exception as e: