mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Fix TmpDir and Location
TmpDir: Clean up before and after, not just after Location: Resolve path so that parent check works properly
This commit is contained in:
parent
2de4255a78
commit
df0eb84a44
@ -18,6 +18,7 @@ class TmpDir(Location):
|
|||||||
"""Create a new temporary folder for the given path."""
|
"""Create a new temporary folder for the given path."""
|
||||||
super().__init__(path)
|
super().__init__(path)
|
||||||
self._counter = 0
|
self._counter = 0
|
||||||
|
self.cleanup()
|
||||||
self.path.mkdir(parents=True, exist_ok=True)
|
self.path.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
|
@ -88,7 +88,7 @@ class Location:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, path: Path):
|
def __init__(self, path: Path):
|
||||||
self._path = path
|
self._path = path.resolve()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def path(self) -> Path:
|
def path(self) -> Path:
|
||||||
|
Loading…
Reference in New Issue
Block a user