diff 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
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/importer.py	Mon Jan 28 12:27:04 2013 +0100
+++ b/flys-backend/contrib/shpimporter/importer.py	Mon Jan 28 12:44:41 2013 +0100
@@ -171,15 +171,16 @@
         shpimporter.INFO("Failed to create %i features" % creationFailed)
         shpimporter.INFO("Found %i unsupported features" % unsupported)
 
-        unhandled = []
-        for i in range(0, srcLayer.GetLayerDefn().GetFieldCount()):
-            act_field = srcLayer.GetLayerDefn().GetFieldDefn(i).GetNameRef()
-            if not act_field in self.handled_fields:
-                unhandled.append(act_field)
+        if self.tracking_import:
+            unhandled = []
+            for i in range(0, srcLayer.GetLayerDefn().GetFieldCount()):
+                act_field = srcLayer.GetLayerDefn().GetFieldDefn(i).GetNameRef()
+                if not act_field in self.handled_fields:
+                    unhandled.append(act_field)
 
-        if len(unhandled):
-            shpimporter.INFO("Did not import values from fields: %s " % \
-                    " ".join(unhandled))
+            if len(unhandled):
+                shpimporter.INFO("Did not import values from fields: %s " % \
+                        " ".join(unhandled))
 
         try:
             if self.config.dry_run > 0:

http://dive4elements.wald.intevation.org