Skip to content

Commit

Permalink
Remove migrate_old_config() method. Shouldn't be needed anymore. (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpepple authored Oct 30, 2023
1 parent 41b3a87 commit c40e5f1
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions metrontagger/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit c40e5f1

Please sign in to comment.