diff options
| author | Daniel Schadt <kingdread@gmx.de> | 2026-10-08 09:39:56 +0200 |
|---|---|---|
| committer | Daniel Schadt <kingdread@gmx.de> | 2026-10-08 09:39:56 +0200 |
| commit | 4508653f3e802928deebe55b0f84ac961c6ac86a (patch) | |
| tree | c1d94cd1d508c18d45466ed71f0726a7b66a178a | |
| parent | 6090bc0fdc278b86723f1d6e626ac04b80d031ae (diff) | |
| download | fietsboek-4508653f3e802928deebe55b0f84ac961c6ac86a.tar.gz fietsboek-4508653f3e802928deebe55b0f84ac961c6ac86a.tar.bz2 fietsboek-4508653f3e802928deebe55b0f84ac961c6ac86a.zip | |
merge find_names into overpass_api
this also fixes the mistake that the update script didn't pass a
overpass API
| -rw-r--r-- | fietsboek/actions.py | 9 | ||||
| -rw-r--r-- | fietsboek/updater/scripts/upd_20260930_7fa8kflikvnlvuqe.py | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/fietsboek/actions.py b/fietsboek/actions.py index 3be9342..c467cc2 100644 --- a/fietsboek/actions.py +++ b/fietsboek/actions.py @@ -304,9 +304,7 @@ def extract_climbs( track: models.Track, tile_requester: TileRequester, layer: TileLayerConfig, - overpass_api: OverpassApi, - *, - find_names: bool = True, + overpass_api: OverpassApi | None, ): """(Re-)extracts the climbs from the given track. @@ -316,7 +314,8 @@ def extract_climbs( :param track: The track for which to extract climbs. :param tile_requester: The tile requester to use to render preview images. :param layer: The layer to use for preview images. - :param overpass_api: The overpass API to use for naming the climbs. + :param overpass_api: The overpass API to use for naming the climbs. If + ``None``, climbs will not be named. :param find_names: Whether names should be searched or not. """ # pylint: disable=too-many-locals,too-many-arguments @@ -343,7 +342,7 @@ def extract_climbs( LOGGER.debug("Warning: zero length for climb in track %s", track.id) name = None - if find_names: + if overpass_api is not None: name = osm.find_name(overpass_api, subpath) climb = models.Climb( diff --git a/fietsboek/updater/scripts/upd_20260930_7fa8kflikvnlvuqe.py b/fietsboek/updater/scripts/upd_20260930_7fa8kflikvnlvuqe.py index 5ed4ae1..e708b8e 100644 --- a/fietsboek/updater/scripts/upd_20260930_7fa8kflikvnlvuqe.py +++ b/fietsboek/updater/scripts/upd_20260930_7fa8kflikvnlvuqe.py @@ -38,7 +38,7 @@ class Up(UpdateScript): with Session() as session: for track in session.execute(select(Track)).scalars(): self.tell(f"Extracting climbs for track {track.id}") - actions.extract_climbs(session, track, tile_requester, layer, find_names=False) + actions.extract_climbs(session, track, tile_requester, layer, None) session.commit() self.tell("Done extracting climbs") |
