diff flys-backend/contrib/shpimporter/importer.py @ 5401:ff11b178f152

Fix searchValue and mark a field where a string is found as handled
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 25 Mar 2013 12:19:40 +0100
parents 6c2751c17869
children db5def5456ce
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/importer.py	Mon Mar 25 15:41:16 2013 +0100
+++ b/flys-backend/contrib/shpimporter/importer.py	Mon Mar 25 12:19:40 2013 +0100
@@ -47,12 +47,15 @@
 
     def searchValue(self, feat, regex):
         """
-        Searches for a value that matches regx in all attribute
+        Searches for a value that matches regex in all attribute
         fields of a feature.
+
+        @returns the name of the field where a match was found or None
         """
         for val in feat.items():
-            match = re.match(regex, val, re.IGNORECASE)
-            return match != None
+            match = re.match(regex, feat.items()[val], re.IGNORECASE)
+            if match:
+                return val
 
     def searchField(self, regex):
         """

http://dive4elements.wald.intevation.org