Fix docstring typos

This commit is contained in:
Timmy Welch 2023-02-04 14:34:13 -08:00
parent 8146b0c90e
commit 5e86605a46
No known key found for this signature in database

View File

@ -30,28 +30,28 @@ class Archiver(Protocol):
def get_comment(self) -> str:
"""
Returns the comment from the archive as a string.
Returns the comment from the current archive as a string.
Should always return a string. If comments are not supported in the archive the empty string should be returned.
"""
return ""
def set_comment(self, comment: str) -> bool:
"""
Returns True if the comment was successfully set on the archive.
Returns True if the comment was successfully set on the current archive.
Should always return a boolean. If comments are not supported in the archive False should be returned.
"""
return False
def supports_comment(self) -> bool:
"""
Returns True if the archive supports comments.
Returns True if the current archive supports comments.
Should always return a boolean. If comments are not supported in the archive False should be returned.
"""
return False
def read_file(self, archive_file: str) -> bytes:
"""
Reads the named file from the archive.
Reads the named file from the current archive.
archive_file should always come from the output of get_filename_list.
Should always return a bytes object. Exceptions should be of the type OSError.
"""
@ -59,7 +59,7 @@ class Archiver(Protocol):
def remove_file(self, archive_file: str) -> bool:
"""
Removes the named file from the archive.
Removes the named file from the current archive.
archive_file should always come from the output of get_filename_list.
Should always return a boolean. Failures should return False.
@ -69,42 +69,42 @@ class Archiver(Protocol):
def write_file(self, archive_file: str, data: bytes) -> bool:
"""
Writes the named file to the archive.
Writes the named file to the current archive.
Should always return a boolean. Failures should return False.
"""
return False
def get_filename_list(self) -> list[str]:
"""
Returns a list of filenames in the archive.
Returns a list of filenames in the current archive.
Should always return a list of string. Failures should return an empty list.
"""
return []
def copy_from_archive(self, other_archive: Archiver) -> bool:
"""
Copies the contents of another achive to this archive.
Copies the contents of another achive to the current archive.
Should always return a boolean. Failures should return False.
"""
return False
def is_writable(self) -> bool:
"""
Retuns True if the archive is writeable
Retuns True if the current archive is writeable
Should always return a boolean. Failures should return False.
"""
return False
def extension(self) -> str:
"""
Returns the extension that this archive should use eg ".cbz".
Returns the extension that this archiver should use eg ".cbz".
Should always return a string. Failures should return the empty string.
"""
return ""
def name(self) -> str:
"""
Returns the name of this archive for display purposes eg "CBZ".
Returns the name of this archiver for display purposes eg "CBZ".
Should always return a string. Failures should return the empty string.
"""
return ""
@ -112,7 +112,7 @@ class Archiver(Protocol):
@classmethod
def is_valid(cls, path: pathlib.Path) -> bool:
"""
Returns True if the given path can be opened by this archive.
Returns True if the given path can be opened by this archiver.
Should always return a boolean. Failures should return False.
"""
return False