- removed unused imports

- swapped out `typing` to `collections.abc`
- removed unnecessary `str()` conversion in `FileDeleterHelper` constructor and `set_filepath`
This commit is contained in:
peterbousaada
2024-06-13 11:47:24 -04:00
committed by Travis Abendshien
parent a074912ac8
commit 8d19bef152

View File

@@ -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