mirror of
https://github.com/DarrylNixon/melamine.git
synced 2024-04-22 06:27:20 -07:00
Potential fix for async init returning coro
This commit is contained in:
parent
d8b3fb7f17
commit
559d63dea9
1 changed files with 12 additions and 2 deletions
|
@ -30,7 +30,17 @@ async def get_all_hardlinks(paths: Set[Path]) -> None:
|
||||||
return paths
|
return paths
|
||||||
|
|
||||||
|
|
||||||
class ShredDir:
|
class AsyncObject(object):
|
||||||
|
async def __new__(cls, *a, **kw):
|
||||||
|
instance = super().__new__(cls)
|
||||||
|
await instance.__init__(*a, **kw)
|
||||||
|
return instance
|
||||||
|
|
||||||
|
async def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ShredDir(AsyncObject):
|
||||||
"""Class for tracking each directory to be shredded, and its contents."""
|
"""Class for tracking each directory to be shredded, and its contents."""
|
||||||
|
|
||||||
async def __init__(self, path: Path) -> None:
|
async def __init__(self, path: Path) -> None:
|
||||||
|
@ -70,7 +80,7 @@ class ShredDir:
|
||||||
return hash(self.absolute_path)
|
return hash(self.absolute_path)
|
||||||
|
|
||||||
|
|
||||||
class ShredFile:
|
class ShredFile(AsyncObject):
|
||||||
"""Class for tracking each file to be shredded."""
|
"""Class for tracking each file to be shredded."""
|
||||||
|
|
||||||
async def __init__(self, path: Path) -> None:
|
async def __init__(self, path: Path) -> None:
|
||||||
|
|
Loading…
Reference in a new issue