Skip to content

Commit

Permalink
[2114] Update Pathlib Usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Rixxan committed Jul 22, 2024
1 parent 6139d66 commit 40463d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def help_open_log_folder() -> None:
"""Open the folder logs are stored in."""
warnings.warn('prefs.help_open_log_folder is deprecated, use open_log_folder instead. '
'This function will be removed in 6.0 or later', DeprecationWarning, stacklevel=2)
open_folder(pathlib.Path(config.app_dir_path / 'logs'))
open_folder(Path(config.app_dir_path / 'logs'))


def open_folder(file: Path) -> None:
Expand Down Expand Up @@ -322,7 +322,7 @@ def __init__(self, parent: tk.Tk, callback: Optional[Callable]):
self.geometry(f"+{position.left}+{position.top}")

# Set Log Directory
self.logfile_loc = pathlib.Path(config.app_dir_path / 'logs')
self.logfile_loc = Path(config.app_dir_path / 'logs')

# Set minimum size to prevent content cut-off
self.update_idletasks() # Update "requested size" from geometry manager
Expand Down Expand Up @@ -1299,8 +1299,8 @@ def apply(self) -> None: # noqa: CCR001
if self.plugdir.get() != config.get('plugin_dir'):
config.set(
'plugin_dir',
join(config.home_path, self.plugdir.get()[2:]) if self.plugdir.get().startswith(
'~') else self.plugdir.get()
str(Path(config.home_path, self.plugdir.get()[2:])) if self.plugdir.get().startswith('~') else
str(Path(self.plugdir.get()))
)
self.req_restart = True

Expand Down

0 comments on commit 40463d4

Please sign in to comment.