instagram.gdpr: use ZipPath instead of adhoc zipfile methods
this allows using the module more agnostic whether the gpdr archive is packed or unpacked
This commit is contained in:
parent
7c0f304f94
commit
706ec03a3f
2 changed files with 28 additions and 19 deletions
|
@ -164,6 +164,15 @@ class ZipPath(ZipPathBase):
|
|||
assert self.root == other.root, (self.root, other.root)
|
||||
return Path(self.at).relative_to(Path(other.at))
|
||||
|
||||
@property
|
||||
def parts(self) -> Sequence[str]:
|
||||
# messy, but might be ok..
|
||||
return Path(self.filename).parts + Path(self.at).parts
|
||||
|
||||
@property
|
||||
def stem(self) -> str:
|
||||
return Path(self.at).stem
|
||||
|
||||
@property # type: ignore[misc]
|
||||
def __class__(self):
|
||||
return Path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue