jan: thuban/Extensions/svgexport __init__.py,1.2,1.3
cvs@intevation.de
cvs at intevation.de
Wed Nov 24 23:35:59 CET 2004
Author: jan
Update of /thubanrepository/thuban/Extensions/svgexport
In directory doto:/tmp/cvs-serv27631
Modified Files:
__init__.py
Log Message:
Fix to have the extensions' test module also be executed from the
global test routine.
This is done by looking for the absense of the DISPLAY variable.
Index: __init__.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/svgexport/__init__.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- __init__.py 20 Nov 2004 12:52:50 -0000 1.2
+++ __init__.py 24 Nov 2004 22:35:57 -0000 1.3
@@ -6,8 +6,17 @@
# This program is free software under the GPL (>=v2)
# Read the file COPYING coming with the software for details.
-# import the actual module
-import svgsaver
+# import the actual modules
+from os import environ
+try:
+ dummy = environ["DISPLAY"]
+ import svgsaver
+ import maplegend
+except:
+ pass # we don't have a DISPLAY, so don't import the modules
+ # (we probably are in test-mode)
+ # Not sure whether this is the best method to avoid problems
+ # in the global test routine.
# perform the registration of the extension
from Thuban import _
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)