changeset 5004:f1c01fecf194 dami

Fix imports of ogr, this removes a warning in gdal 1.9 but keeps compatibility with older versions
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 15 Feb 2013 16:18:34 +0100
parents 563ff8893d47
children eb2d6609387c
files flys-backend/contrib/shpimporter/axis.py flys-backend/contrib/shpimporter/boundaries.py flys-backend/contrib/shpimporter/buildings.py flys-backend/contrib/shpimporter/catchments.py flys-backend/contrib/shpimporter/crosssectiontracks.py flys-backend/contrib/shpimporter/fixpoints.py flys-backend/contrib/shpimporter/floodplains.py flys-backend/contrib/shpimporter/gauges.py flys-backend/contrib/shpimporter/importer.py flys-backend/contrib/shpimporter/km.py flys-backend/contrib/shpimporter/uesg.py
diffstat 11 files changed, 42 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/axis.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/axis.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,7 +1,9 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
-import shpimporter
 
 NAME="Axis"
 TABLE_NAME="river_axes"
--- a/flys-backend/contrib/shpimporter/boundaries.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/boundaries.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
 
--- a/flys-backend/contrib/shpimporter/buildings.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/buildings.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
 
--- a/flys-backend/contrib/shpimporter/catchments.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/catchments.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
 
--- a/flys-backend/contrib/shpimporter/crosssectiontracks.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/crosssectiontracks.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
 
--- a/flys-backend/contrib/shpimporter/fixpoints.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/fixpoints.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr, osr
+try:
+    from osgeo import ogr, osr
+except ImportErrror:
+    import ogr, osr
 
 from importer import Importer
 
--- a/flys-backend/contrib/shpimporter/floodplains.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/floodplains.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
 
--- a/flys-backend/contrib/shpimporter/gauges.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/gauges.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
 
--- a/flys-backend/contrib/shpimporter/importer.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/importer.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,9 +1,7 @@
 try:
-    from osgeo import ogr
+    from osgeo import ogr, osr
 except ImportErrror:
-    import ogr
-import osr
-import shpimporter
+    import ogr, osr
 import utils
 import re
 
--- a/flys-backend/contrib/shpimporter/km.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/km.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
 
--- a/flys-backend/contrib/shpimporter/uesg.py	Fri Feb 15 15:03:48 2013 +0100
+++ b/flys-backend/contrib/shpimporter/uesg.py	Fri Feb 15 16:18:34 2013 +0100
@@ -1,4 +1,7 @@
-import ogr
+try:
+    from osgeo import ogr
+except ImportErrror:
+    import ogr
 
 from importer import Importer
 

http://dive4elements.wald.intevation.org