From 8d19bef152f72509036cfda59e1aa589333b7baf Mon Sep 17 00:00:00 2001 From: peterbousaada Date: Thu, 13 Jun 2024 11:47:24 -0400 Subject: [PATCH] - removed unused imports - swapped out `typing` to `collections.abc` - removed unnecessary `str()` conversion in `FileDeleterHelper` constructor and `set_filepath` --- tagstudio/src/qt/helpers/file_deleter.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tagstudio/src/qt/helpers/file_deleter.py b/tagstudio/src/qt/helpers/file_deleter.py index 104b7746..d8a36e34 100644 --- a/tagstudio/src/qt/helpers/file_deleter.py +++ b/tagstudio/src/qt/helpers/file_deleter.py @@ -1,10 +1,7 @@ import logging -import pathlib -import subprocess -import sys import traceback from pathlib import Path -from typing import Callable +from collections.abc import Callable ERROR = f"[ERROR]" WARNING = f"[WARNING]" @@ -12,7 +9,6 @@ INFO = f"[INFO]" logging.basicConfig(format="%(message)s", level=logging.INFO) - def delete_file(path: str | Path, callback: Callable): _path = str(path) _file = Path(_path) @@ -29,10 +25,10 @@ def delete_file(path: str | Path, callback: Callable): class FileDeleterHelper: def __init__(self, filepath: str | Path): - self.filepath = str(filepath) + self.filepath = filepath def set_filepath(self, filepath: str | Path): - self.filepath = str(filepath) + self.filepath = filepath def set_delete_callback(self, callback: Callable): self.delete_callback = callback