[Thuban-commits] r2683 - in trunk/thuban: . Extensions/ogr

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed May 17 21:32:46 CEST 2006


Author: dpinte
Date: 2006-05-17 21:32:45 +0200 (Wed, 17 May 2006)
New Revision: 2683

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Extensions/ogr/__init__.py
Log:
2006-05-17 Didrik Pinte <dpinte at itae.be>
    * Extensions/ogr/__init__.py : updated test for win32 and correct
    imports
        


Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2006-05-15 20:11:15 UTC (rev 2682)
+++ trunk/thuban/ChangeLog	2006-05-17 19:32:45 UTC (rev 2683)
@@ -1,3 +1,7 @@
+2006-05-17 Didrik Pinte <dpinte at itae.be>
+	* Extensions/ogr/__init__.py : updated test for win32 and correct
+	imports
+
 2006-05-15 Didrik Pinte <dpinte at itae.be>
 	Ashamed ... still some tabs in the files
 

Modified: trunk/thuban/Extensions/ogr/__init__.py
===================================================================
--- trunk/thuban/Extensions/ogr/__init__.py	2006-05-15 20:11:15 UTC (rev 2682)
+++ trunk/thuban/Extensions/ogr/__init__.py	2006-05-17 19:32:45 UTC (rev 2683)
@@ -11,13 +11,16 @@
 
 # import the actual modules
 from os import environ
+from sys import platform
+
 try:
-    dummy = environ["DISPLAY"]
-    import OGR
-    import maplegend
-except:
-    pass # we don't have a DISPLAY, so don't import the modules
-         # (we probably are in test-mode)
+    if platform != 'win32':
+        dummy = environ['DISPLAY']
+    import ogrstart
+except KeyError:
+    pass # For non-win32 platform, we don't have a DISPLAY, so don't import 
+         # the modules (for test mode)
+         # For win32 platform, there is  always have a graphical mode
          # Not sure whether this is the best method to avoid problems
          # in the global test routine.
 



More information about the Thuban-commits mailing list