Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/importer.py @ 5174:b3a15fa3d88e
let import_river.sh parse gauge official numbers, typo
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 05 Mar 2013 18:54:28 +0100 |
parents | 0dae9e77c5da |
children | 90f1c5f67698 |
comparison
equal
deleted
inserted
replaced
5173:14d19313268a | 5174:b3a15fa3d88e |
---|---|
47 | 47 |
48 def searchField(self, regex): | 48 def searchField(self, regex): |
49 """ | 49 """ |
50 Searches for a field in the current src layer that matches | 50 Searches for a field in the current src layer that matches |
51 the expression regex. | 51 the expression regex. |
52 Throws an exception if more then one field matches | 52 Throws an exception if more than one field matches |
53 @param feat: The feature to search for attributes | 53 @param feat: The feature to search for attributes |
54 @param regex: The regex to look for | 54 @param regex: The regex to look for |
55 | 55 |
56 @returns: The field name as a string | 56 @returns: The field name as a string |
57 """ | 57 """ |
65 result = None | 65 result = None |
66 for name in self.srcLayer.fieldnames: | 66 for name in self.srcLayer.fieldnames: |
67 match = re.match(regex, name, re.IGNORECASE) | 67 match = re.match(regex, name, re.IGNORECASE) |
68 if match: | 68 if match: |
69 if result: | 69 if result: |
70 raise Exception("More then one field matches: %s" % regex) | 70 raise Exception("More than one field matches: %s" % regex) |
71 else: | 71 else: |
72 result = match.group(0) | 72 result = match.group(0) |
73 return result | 73 return result |
74 | 74 |
75 def IsDoubleFieldSet(self, feat, name): | 75 def IsDoubleFieldSet(self, feat, name): |