Implement delete instruction
This commit is contained in:
parent
bd8b0415d4
commit
1a0a600fc7
@ -1,11 +1,15 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from karaokatalog.deduplicate.instructions.Instruction import Instruction
|
from karaokatalog.deduplicate.instructions.Instruction import Instruction
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class DeleteInstruction(Instruction):
|
class DeleteInstruction(Instruction):
|
||||||
# TODO Add file to delete
|
"""
|
||||||
|
Deletes the given path (might point to a file, a folder or a link), no questions asked.
|
||||||
|
"""
|
||||||
|
path_to_delete: Path
|
||||||
|
|
||||||
def __call__(self) -> None:
|
def __call__(self) -> None:
|
||||||
pass # TODO Implement
|
self.path_to_delete.unlink()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user