diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:22:58 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:22:58 +0100 |
commit | a35b33f4f1ddcf6f1bb8ab0f41b87bf2b847f11d (patch) | |
tree | fb220da28bb7248ebf37ce09af5de88f2c1aaad4 /bsie/base/reader.py | |
parent | 7582c280ad5324a2f0427999911c7e7abc14a6ab (diff) | |
parent | af81318ae9311fd0b0e16949cef3cfaf7996970b (diff) | |
download | bsie-a35b33f4f1ddcf6f1bb8ab0f41b87bf2b847f11d.tar.gz bsie-a35b33f4f1ddcf6f1bb8ab0f41b87bf2b847f11d.tar.bz2 bsie-a35b33f4f1ddcf6f1bb8ab0f41b87bf2b847f11d.zip |
Diffstat (limited to 'bsie/base/reader.py')
-rw-r--r-- | bsie/base/reader.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/bsie/base/reader.py b/bsie/base/reader.py deleted file mode 100644 index cbabd36..0000000 --- a/bsie/base/reader.py +++ /dev/null @@ -1,47 +0,0 @@ -"""The Reader classes return high-level content structures from files. - -The Reader fulfills two purposes: - First, it brokers between multiple libraries and file formats. - Second, it separates multiple aspects of a file into distinct content types. - -Part of the bsie module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" -# imports -import abc -import typing - -# bsie imports -from bsie.utils import bsfs - -# exports -__all__: typing.Sequence[str] = ( - 'Reader', - ) - - -## code ## - -class Reader(abc.ABC): - """Read and return some content from a file.""" - - def __str__(self) -> str: - return bsfs.typename(self) - - def __repr__(self) -> str: - return f'{bsfs.typename(self)}()' - - def __eq__(self, other: typing.Any) -> bool: - return isinstance(other, type(self)) - - def __hash__(self) -> int: - return hash(type(self)) - - @abc.abstractmethod - def __call__(self, path: bsfs.URI) -> typing.Any: - """Return some content of the file at *path*. - Raises a `ReaderError` if the reader cannot make sense of the file format. - """ - -## EOF ## |