[Dive4elements-commits] [PATCH 1 of 3] Fix imports of ogr, this removes a warning in gdal 1.9 but keeps

Wald Commits scm-commit at wald.intevation.org
Fri Feb 15 16:22:17 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1360941514 -3600
# Branch dami
# Node ID f1c01fecf1942fcdc2f4f6ad6399e82319926bc2
# Parent  563ff8893d47ba0613b10abcc38bd48b97ac098d
Fix imports of ogr, this removes a warning in gdal 1.9 but keeps
compatibility with older versions

diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/axis.py
--- 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"
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/boundaries.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/buildings.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/catchments.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/crosssectiontracks.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/fixpoints.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/floodplains.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/gauges.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/importer.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/km.py
--- 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
 
diff -r 563ff8893d47 -r f1c01fecf194 flys-backend/contrib/shpimporter/uesg.py
--- 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
 


More information about the Dive4elements-commits mailing list