Fix typing
This commit is contained in:
parent
f6698f7f0a
commit
2de241cdd5
@ -93,5 +93,5 @@ class FolderArchiver(Archiver):
|
||||
return "Folder"
|
||||
|
||||
@classmethod
|
||||
def is_valid(cls, path: pathlib.Path | str) -> bool:
|
||||
return os.path.isdir(path)
|
||||
def is_valid(cls, path: pathlib.Path) -> bool:
|
||||
return path.is_dir()
|
||||
|
@ -246,7 +246,7 @@ class RarArchiver(Archiver):
|
||||
return "RAR"
|
||||
|
||||
@classmethod
|
||||
def is_valid(cls, path: pathlib.Path | str) -> bool:
|
||||
def is_valid(cls, path: pathlib.Path) -> bool:
|
||||
if rar_support:
|
||||
return rarfile.is_rarfile(str(path))
|
||||
return False
|
||||
|
@ -127,5 +127,5 @@ class SevenZipArchiver(Archiver):
|
||||
return "Seven Zip"
|
||||
|
||||
@classmethod
|
||||
def is_valid(cls, path: pathlib.Path | str) -> bool:
|
||||
def is_valid(cls, path: pathlib.Path) -> bool:
|
||||
return py7zr.is_7zfile(path)
|
||||
|
@ -129,7 +129,7 @@ class ZipArchiver(Archiver):
|
||||
return "ZIP"
|
||||
|
||||
@classmethod
|
||||
def is_valid(cls, path: pathlib.Path | str) -> bool:
|
||||
def is_valid(cls, path: pathlib.Path) -> bool:
|
||||
return zipfile.is_zipfile(path)
|
||||
|
||||
def write_zip_comment(self, filename: pathlib.Path | str, comment: str) -> bool:
|
||||
|
Loading…
Reference in New Issue
Block a user