diff --git a/disco-reaper.py b/disco-reaper.py index c480b48..1949111 100644 --- a/disco-reaper.py +++ b/disco-reaper.py @@ -5,7 +5,7 @@ from src.core.configuration import load_config def setup_logging(): try: - config = load_config() + config = load_config(create_if_missing=False) log_level_str = config.migration.log_level.upper() level = getattr(logging, log_level_str, logging.INFO) except Exception: diff --git a/src/core/configuration.py b/src/core/configuration.py index c028660..5c8f9d2 100644 --- a/src/core/configuration.py +++ b/src/core/configuration.py @@ -54,9 +54,12 @@ class AppConfig(BaseModel): def stoat_api_url(self) -> Optional[str]: return self.target_api_url if self.target_platform == "stoat" else None -def load_config(config_path: Union[str, Path] = "config.yaml") -> AppConfig: +def load_config(config_path: Union[str, Path] = "config.yaml", create_if_missing: bool = True) -> AppConfig: path = Path(config_path) if not path.exists(): + if not create_if_missing: + raise FileNotFoundError(f"Configuration file not found: {config_path}") + config = AppConfig( discord_bot_token="DISCORD_BOT_TOKEN", discord_server_id="DISCORD_SERVER_ID", diff --git a/src/ui/backup_ops.py b/src/ui/backup_ops.py index 821e7c6..ad0c5d9 100644 --- a/src/ui/backup_ops.py +++ b/src/ui/backup_ops.py @@ -168,21 +168,6 @@ class BackupPane(Container): modal.write(f" Channels: [green]{len(getattr(server, 'channels', []))}[/green]") modal.write("") - modal.show_info("[bold cyan]Profile Backup Ready[/bold cyan]", f"Overview: {len(server.channels) if server else '?'} Channels, {len(server.roles) if server else '?'} Roles") - modal.set_status("Awaiting Confirmation to Backup Profile...") - - choice = await modal.phase_wait_confirm( - btn_start_label="Start Backup", - show_id=False - ) - if choice in ("btn_back", "btn_main_menu"): - modal.dismiss() - self.engine.is_running = False - await self.engine.close_connections() - if choice == "btn_main_menu": - self.app.switch_screen("config_selection") - return - modal.cancel_callback = lambda: setattr(self.engine, "is_running", False) modal.phase_progress() modal.set_status("Exporting Server Structure...") @@ -417,7 +402,7 @@ class BackupPane(Container): modal_prog.write(f" Roles: [green]{len(getattr(server, 'roles', []))}[/green]") modal_prog.write(f" Emojis: [green]{len(getattr(server, 'emojis', []))}[/green]") modal_prog.write(f" Channels: [green]{len(getattr(server, 'channels', []))}[/green]") - modal_prog.write("\n[dim]This operation will update the profile and scan existing baked-up channels for new messages.[/dim]") + modal_prog.write("\n[dim]This operation will update the profile and scan existing backed-up channels for new messages.[/dim]") modal_prog.write("") modal_prog.show_info("[bold green]Sync Ready[/bold green]", f"Overview: {len(server.channels) if server else '?'} Channels")