aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fietsboek/updater/__init__.py4
-rw-r--r--fietsboek/updater/cli.py (renamed from fietsboek/updater/__main__.py)0
-rw-r--r--setup.py1
3 files changed, 3 insertions, 2 deletions
diff --git a/fietsboek/updater/__init__.py b/fietsboek/updater/__init__.py
index 038fcd5..724defa 100644
--- a/fietsboek/updater/__init__.py
+++ b/fietsboek/updater/__init__.py
@@ -244,7 +244,7 @@ class Updater:
)
filename = f"upd_{revision_id}.py"
- filepath = Path(__file__).parent / filename
+ filepath = Path(__file__).parent / "scripts" / filename
LOGGER.info("Writing new revision (%s) to %r", revision_id, filepath)
with open(filepath, "x", encoding="utf-8") as fobj:
fobj.write(revision)
@@ -346,7 +346,7 @@ def _filename_to_modname(name):
def _load_update_scripts():
"""Loads all available import scripts."""
- files = importlib_resources.files(__name__)
+ files = importlib_resources.files(__name__) / "scripts"
return [
UpdateScript(file.read_text(), _filename_to_modname(file.name))
for file in files.iterdir()
diff --git a/fietsboek/updater/__main__.py b/fietsboek/updater/cli.py
index 38297d7..38297d7 100644
--- a/fietsboek/updater/__main__.py
+++ b/fietsboek/updater/cli.py
diff --git a/setup.py b/setup.py
index ad759ef..5fd76e0 100644
--- a/setup.py
+++ b/setup.py
@@ -63,6 +63,7 @@ setup(
],
'console_scripts': [
'fietsctl=fietsboek.scripts.fietsctl:main',
+ 'fietsupdate=fietsboek.updater.cli:cli',
],
},
)