From c40e5f13b5d3fe02b6066855752452f052c2b527 Mon Sep 17 00:00:00 2001 From: Brian Pepple Date: Mon, 30 Oct 2023 13:39:04 -0400 Subject: [PATCH] Remove migrate_old_config() method. Shouldn't be needed anymore. (#94) --- metrontagger/settings.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/metrontagger/settings.py b/metrontagger/settings.py index 79c5d6e..ad57498 100644 --- a/metrontagger/settings.py +++ b/metrontagger/settings.py @@ -5,11 +5,8 @@ from pathlib import Path, PurePath from typing import Optional -import questionary from xdg.BaseDirectory import save_config_path -from metrontagger.styles import Styles - class MetronTaggerSettings: """Class to handle project settings""" @@ -46,9 +43,6 @@ def __init__(self: "MetronTaggerSettings", config_dir: Optional[str] = None) -> if not self.settings_file.parent.exists(): self.settings_file.parent.mkdir() - # We can probably remove this in a year or so. Around 2023-06-01 - self._migrate_old_config() - # Write the config file if it doesn't exist if not self.settings_file.exists(): self.save() @@ -65,22 +59,6 @@ def get_settings_folder() -> Path: windows_path = PurePath(environ["APPDATA"]).joinpath("MetronTagger") return Path(windows_path) - def _migrate_old_config(self: "MetronTaggerSettings") -> None: - old_config = Path.home() / ".MetronTagger" / "settings.ini" - if old_config.exists(): - # Let's move any existing config to the new location - old_config.replace(self.settings_file) - questionary.print( - f"Migrated existing configuration to: {self.settings_file.parent}", - style=Styles.WARNING, - ) - if old_config.parent.exists(): - questionary.print( - f"Removing old configuration directory: {old_config.parent}", - style=Styles.WARNING, - ) - old_config.parent.rmdir() - def load(self: "MetronTaggerSettings") -> None: """Method to retrieve a users settings""" self.config.read(self.settings_file)