diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-04-05 17:22:59 +0200 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-04-05 17:22:59 +0200 |
commit | 0b6b1d27756d1c02a2a667ebfc1a119081ff079f (patch) | |
tree | ed1dacee986c3b0bf1387fed58c6128616ced571 | |
parent | ef50c1895c810d7a03bc139587a345273701cdbe (diff) | |
download | bsie-0b6b1d27756d1c02a2a667ebfc1a119081ff079f.tar.gz bsie-0b6b1d27756d1c02a2a667ebfc1a119081ff079f.tar.bz2 bsie-0b6b1d27756d1c02a2a667ebfc1a119081ff079f.zip |
config file fix
-rw-r--r-- | bsie/apps/_loader.py | 6 | ||||
-rw-r--r-- | bsie/apps/index.py | 2 | ||||
-rw-r--r-- | bsie/apps/info.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/bsie/apps/_loader.py b/bsie/apps/_loader.py index 6411f10..d9ea9bb 100644 --- a/bsie/apps/_loader.py +++ b/bsie/apps/_loader.py @@ -1,5 +1,6 @@ # standard imports +import os import typing # external imports @@ -12,8 +13,7 @@ from bsie.lib.pipeline import Pipeline from bsie.reader import ReaderBuilder # constants -DEFAULT_CONFIG_FILE = 'default_config.yaml' - +DEFAULT_CONFIG_FILE = os.path.join(os.path.dirname(__file__), 'default_config.yaml') # exports __all__: typing.Sequence[str] = ( 'DEFAULT_CONFIG_FILE', @@ -23,7 +23,7 @@ __all__: typing.Sequence[str] = ( ## code ## -def load_pipeline(path: str) -> Pipeline: +def load_pipeline(path: str = DEFAULT_CONFIG_FILE) -> Pipeline: """Load a pipeline according to a config at *path*.""" # load config file with open(path, 'rt', encoding='utf-8') as ifile: diff --git a/bsie/apps/index.py b/bsie/apps/index.py index d64e8c2..ef467bd 100644 --- a/bsie/apps/index.py +++ b/bsie/apps/index.py @@ -23,7 +23,7 @@ def main(argv): """Index files or directories into BSFS.""" parser = argparse.ArgumentParser(description=main.__doc__, prog='index') parser.add_argument('--config', type=str, - default=os.path.join(os.path.dirname(__file__), _loader.DEFAULT_CONFIG_FILE), + default=_loader.DEFAULT_CONFIG_FILE, help='Path to the config file.') parser.add_argument('--host', type=bsfs.URI, default=bsfs.URI('http://example.com'), help='') diff --git a/bsie/apps/info.py b/bsie/apps/info.py index e27b70b..b6494da 100644 --- a/bsie/apps/info.py +++ b/bsie/apps/info.py @@ -23,7 +23,7 @@ def main(argv): """Show information from BSIE.""" parser = argparse.ArgumentParser(description=main.__doc__, prog='info') parser.add_argument('--config', type=str, - default=os.path.join(os.path.dirname(__file__), _loader.DEFAULT_CONFIG_FILE), + default=_loader.DEFAULT_CONFIG_FILE, help='Path to the config file.') parser.add_argument('what', choices=('predicates', 'schema'), help='Select what information to show.') |