aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlist-observations8
1 files changed, 5 insertions, 3 deletions
diff --git a/list-observations b/list-observations
index 0a9764c..91aeeec 100755
--- a/list-observations
+++ b/list-observations
@@ -213,9 +213,11 @@ while feature is not None:
vernacularName = getField(feature, 'VernacularName')
if vernacularName is None:
raise Exception('Missing name')
- if args.taxon is not None and vernacularName.lower() not in args.taxon:
- feature = layer.GetNextFeature()
- continue
+ if args.taxon is not None:
+ name = vernacularName.lower()
+ if not any([sub in name for sub in args.taxon]):
+ feature = layer.GetNextFeature()
+ continue
protectedByLaw = feature.GetField('ProtectedByLaw')
if args.protected and (protectedByLaw is None or not protectedByLaw):