Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/importer.py @ 4886:8e99d2d9364d
Importer: When not tracking dont print info about unimported fields
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 28 Jan 2013 12:44:41 +0100 |
parents | 89a8764cabcc |
children | c0a58558b817 |
comparison
equal
deleted
inserted
replaced
4885:89a8764cabcc | 4886:8e99d2d9364d |
---|---|
169 | 169 |
170 shpimporter.INFO("Inserted %i features" % success) | 170 shpimporter.INFO("Inserted %i features" % success) |
171 shpimporter.INFO("Failed to create %i features" % creationFailed) | 171 shpimporter.INFO("Failed to create %i features" % creationFailed) |
172 shpimporter.INFO("Found %i unsupported features" % unsupported) | 172 shpimporter.INFO("Found %i unsupported features" % unsupported) |
173 | 173 |
174 unhandled = [] | 174 if self.tracking_import: |
175 for i in range(0, srcLayer.GetLayerDefn().GetFieldCount()): | 175 unhandled = [] |
176 act_field = srcLayer.GetLayerDefn().GetFieldDefn(i).GetNameRef() | 176 for i in range(0, srcLayer.GetLayerDefn().GetFieldCount()): |
177 if not act_field in self.handled_fields: | 177 act_field = srcLayer.GetLayerDefn().GetFieldDefn(i).GetNameRef() |
178 unhandled.append(act_field) | 178 if not act_field in self.handled_fields: |
179 unhandled.append(act_field) | |
179 | 180 |
180 if len(unhandled): | 181 if len(unhandled): |
181 shpimporter.INFO("Did not import values from fields: %s " % \ | 182 shpimporter.INFO("Did not import values from fields: %s " % \ |
182 " ".join(unhandled)) | 183 " ".join(unhandled)) |
183 | 184 |
184 try: | 185 try: |
185 if self.config.dry_run > 0: | 186 if self.config.dry_run > 0: |
186 return geomType | 187 return geomType |
187 destLayer.CommitTransaction() | 188 destLayer.CommitTransaction() |