From ec3bf656ef3365026678edc95c4cbaf4a07e6d5e Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 3 Apr 2023 21:01:18 +0200 Subject: hittekaart: no error if no input files are passed --- fietsboek/hittekaart.py | 5 +++++ 1 file changed, 5 insertions(+) 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: -- cgit v1.2.3