mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-29 06:10:51 +00:00
- removed unused imports
- swapped out `typing` to `collections.abc` - removed unnecessary `str()` conversion in `FileDeleterHelper` constructor and `set_filepath`
This commit is contained in:
committed by
Travis Abendshien
parent
a074912ac8
commit
8d19bef152
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user