diff --git a/download_files_from_LGL_BW.py b/download_files_from_LGL_BW.py index d9f325e45cc663935bffd7a66aa6e4db336dc6fa..bbb408b74a1d2dc216fb3d398dda2b44e9d5b25a 100644 --- a/download_files_from_LGL_BW.py +++ b/download_files_from_LGL_BW.py @@ -46,7 +46,15 @@ SCRIPT_DIR = Path(__file__).parent WAIT_BETWEEN_DOWNLOADS = 5 # [s] Be nice to LGL Server. if EXTRACT_REGIONS: - SIMSTADT_FOLDER = next(Path.home().glob('Desktop/SimStadt*_0.*/')) + try: + SIMSTADT_FOLDER = next(x for x in Path.home().glob('Desktop/SimStadt*_0.*/') if x.is_dir()) + print(f"RegionChooser has been found in {SIMSTADT_FOLDER}") + except StopIteration: + exit("No SimStadt installation found!" + "\nPlease copy a SimStadt installation to the desktop," + "\nset EXTRACT_REGIONS to False," + "\nor set SIMSTADT_FOLDER manually: SIMSTADT_FOLDER = Path('/path/to/SimStadt')" + ) GML_GLOB = "LoD2_*/LoD2_*.gml"