mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 22:37:44 +00:00
Autogenerated type safety parameterisation of all methods
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import re
|
||||
|
||||
@@ -12,7 +14,7 @@ from data.activity_ref import ActivityRef
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_activity_ref_info(activity_name, ref_id):
|
||||
def get_activity_ref_info(activity_name: str, ref_id: str) -> ActivityRef | None:
|
||||
"""Look up details of an activity reference (e.g. POTA park) such as name, lat/lon, and grid. Takes in an
|
||||
activity name and a reference ID (both strings) and returns an ActivityRef object populated with as much data
|
||||
as we can find. This makes use of activity ref data in the data store, live lookups from the web, or just
|
||||
@@ -139,7 +141,7 @@ def get_activity_ref_info(activity_name, ref_id):
|
||||
return activity_ref
|
||||
|
||||
|
||||
def populate_missing_activity_ref_info(activity_ref):
|
||||
def populate_missing_activity_ref_info(activity_ref: ActivityRef) -> ActivityRef:
|
||||
"""Look up details of an activity reference (e.g. POTA park) such as name, lat/lon, and grid. Takes in an
|
||||
activity_ref object which must at minimum have a "sig" and an "id". The rest of the object will be populated
|
||||
and returned. Any data currently in the object will be kept, only missing data in the object will be populated
|
||||
|
||||
Reference in New Issue
Block a user