aboutsummaryrefslogtreecommitdiffstats
path: root/list-observations
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2023-11-23 12:07:52 +0100
committerGuilhem Moulin <guilhem@fripost.org>2023-11-23 12:07:52 +0100
commit2542880de09e429e92fa2df574dd8d00d56a9b9e (patch)
tree7427190cc811fe2037a6ab07221a33966c9679e8 /list-observations
parent88749d8cf1e7df54930b4d7f9b1b7a5cd2782975 (diff)
list-observations: Don't choke on missing vernacularName or reporter/observer.HEADmaster
Diffstat (limited to 'list-observations')
-rwxr-xr-xlist-observations10
1 files changed, 6 insertions, 4 deletions
diff --git a/list-observations b/list-observations
index 869e307..5064478 100755
--- a/list-observations
+++ b/list-observations
@@ -224,7 +224,8 @@ def printObservation(feature):
vernacularName = properties.get('VernacularName')
if vernacularName is None:
- raise Exception('Missing name')
+ pass
+ #raise Exception('Missing name')
if args.taxon is not None:
name = vernacularName.lower()
if not any([sub in name for sub in args.taxon]):
@@ -293,7 +294,8 @@ def printObservation(feature):
if sum_count > 0:
print('')
- print(f'Artnamn: {vernacularName.title()}')
+ if vernacularName is not None:
+ print(f'Artnamn: {vernacularName.title()}')
name = vernacularName
if taxonIsRedlisted is not None and taxonIsRedlisted and redlistCategory is not None:
@@ -327,11 +329,11 @@ def printObservation(feature):
if v is not None:
print(f'Metod: {v}')
- if ',' in reportedBy:
+ if reportedBy is not None and ',' in reportedBy:
print(f'Rapportörer: {reportedBy}')
else:
print(f'Rapportör: {reportedBy}')
- if ',' in recordedBy:
+ if recordedBy is not None and ',' in recordedBy:
print(f'Observatörer: {recordedBy}')
else:
print(f'Observatör: {recordedBy}')