mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-20 05:37:43 +00:00
Update the remove all backup plans command.
Refactor the commands names. Add the service to remove all plans. Add tests for remove all command.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
from rich.console import Console
|
||||
import typer
|
||||
|
||||
from tui_rsync.core.components.backup_plan.application.commands import RemoveAllBackupBackupPlansCommand
|
||||
from tui_rsync.core.components.backup_plan.application.services import RemoveAllBackupPlansService
|
||||
from tui_rsync.core.components.backup_plan.application.services.backup_plan_service import BackupPlanService
|
||||
from tui_rsync.core.shared_kernel.components.common import UUID
|
||||
from tui_rsync.core.shared_kernel.ports.Exceptions import CommandException
|
||||
@@ -57,10 +57,9 @@ def all():
|
||||
[red b]Remove[/] [yellow] all existing backup plans[/].
|
||||
"""
|
||||
|
||||
command: RemoveAllBackupBackupPlansCommand = CurrentConfiguration.get(RemoveAllBackupBackupPlansCommand)
|
||||
removed = command.execute()
|
||||
service: RemoveAllBackupPlansService = CurrentConfiguration.get(RemoveAllBackupPlansService)
|
||||
|
||||
if removed:
|
||||
console.print(f"Removed all backup plans.")
|
||||
if service.remove_all():
|
||||
console.print("All backup plans removed.")
|
||||
else:
|
||||
console.print(f"Nothing to remove. No backup plans.")
|
||||
console.print("Nothing to remove. No backup plans.")
|
||||
|
||||
Reference in New Issue
Block a user