aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-04-03 21:01:18 +0200
committerDaniel Schadt <kingdread@gmx.de>2023-04-03 21:01:18 +0200
commitec3bf656ef3365026678edc95c4cbaf4a07e6d5e (patch)
tree064b2f516dd8bb027e87bb26c74371a25668f8d1
parent7efa4be4dc5c41dfb8cd57815fc0d689aab543e0 (diff)
downloadfietsboek-ec3bf656ef3365026678edc95c4cbaf4a07e6d5e.tar.gz
fietsboek-ec3bf656ef3365026678edc95c4cbaf4a07e6d5e.tar.bz2
fietsboek-ec3bf656ef3365026678edc95c4cbaf4a07e6d5e.zip
hittekaart: no error if no input files are passed
-rw-r--r--fietsboek/hittekaart.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/fietsboek/hittekaart.py b/fietsboek/hittekaart.py
index a41f8b7..69b8d42 100644
--- a/fietsboek/hittekaart.py
+++ b/fietsboek/hittekaart.py
@@ -51,6 +51,8 @@ def generate(
:param threads: Number of threads that ``hittekaart`` should use. Defaults
to 0, which uses all available cores.
"""
+ if not input_files:
+ return
# There are two reasons why we do the tempfile dance:
# 1. hittekaart refuses to overwrite existing files
# 2. This way we can (hope for?) an atomic move (at least if temporary file
@@ -109,6 +111,9 @@ def generate_for(
path = data_manager.open(track.id).gpx_path()
input_paths.append(path)
+ if not input_paths:
+ return
+
try:
user_dir = data_manager.initialize_user(user.id)
except FileExistsError: