aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/reader
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2022-11-25 14:36:27 +0100
committerMatthias Baumgartner <dev@igsor.net>2022-11-25 14:36:27 +0100
commitb96c6e2096c387b70e2a4c1f0bc53b6044a0dc6f (patch)
tree0db971d173db4612ada4d87cc5adef601b8f0e9e /bsie/reader
parente174a25585e64eb1b0759440cad48d642dd31829 (diff)
downloadbsie-b96c6e2096c387b70e2a4c1f0bc53b6044a0dc6f.tar.gz
bsie-b96c6e2096c387b70e2a4c1f0bc53b6044a0dc6f.tar.bz2
bsie-b96c6e2096c387b70e2a4c1f0bc53b6044a0dc6f.zip
decouple readers and extractors; use strings for reference and repeated type annotations
Diffstat (limited to 'bsie/reader')
-rw-r--r--bsie/reader/path.py7
-rw-r--r--bsie/reader/stat.py6
2 files changed, 4 insertions, 9 deletions
diff --git a/bsie/reader/path.py b/bsie/reader/path.py
index d27c664..d60f187 100644
--- a/bsie/reader/path.py
+++ b/bsie/reader/path.py
@@ -5,10 +5,9 @@ A copy of the license is provided with the project.
Author: Matthias Baumgartner, 2022
"""
# imports
-import os
import typing
-# inner-module imports
+# bsie imports
from bsie.base import reader
# exports
@@ -22,9 +21,7 @@ __all__: typing.Sequence[str] = (
class Path(reader.Reader):
"""Return the path."""
- CONTENT_TYPE = typing.Union[str]
-
- def __call__(self, path: str) -> CONTENT_TYPE:
+ def __call__(self, path: str) -> str:
return path
diff --git a/bsie/reader/stat.py b/bsie/reader/stat.py
index f0b83fb..6d40ab8 100644
--- a/bsie/reader/stat.py
+++ b/bsie/reader/stat.py
@@ -8,7 +8,7 @@ Author: Matthias Baumgartner, 2022
import os
import typing
-# inner-module imports
+# bsie imports
from bsie.base import reader, errors
# exports
@@ -22,9 +22,7 @@ __all__: typing.Sequence[str] = (
class Stat(reader.Reader):
"""Read and return the filesystem's stat infos."""
- CONTENT_TYPE = typing.Union[os.stat_result]
-
- def __call__(self, path: str) -> CONTENT_TYPE:
+ def __call__(self, path: str) -> os.stat_result:
try:
return os.stat(path)
except Exception: