jan: thuban/Extensions/gns2shp/test test_gns2shp.py,1.1,1.2

cvs@intevation.de cvs at intevation.de
Sat Dec 18 23:40:47 CET 2004


Author: jan

Update of /thubanrepository/thuban/Extensions/gns2shp/test
In directory doto:/tmp/cvs-serv23700

Modified Files:
	test_gns2shp.py 
Log Message:
Add some import paths dynamically.


Index: test_gns2shp.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/gns2shp/test/test_gns2shp.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test_gns2shp.py	4 Sep 2003 15:35:51 -0000	1.1
+++ test_gns2shp.py	18 Dec 2004 22:40:45 -0000	1.2
@@ -1,6 +1,6 @@
-# Copyright (c) 2003 by Intevation GmbH
+# Copyright (c) 2003, 2004 by Intevation GmbH
 # Authors:
-# Jan-Oliver Wagner <jan at intevation.de>
+# Jan-Oliver Wagner <jan at intevation.de> (2003, 2004)
 #
 # This program is free software under the GPL (>=v2)
 # Read the file COPYING coming with Thuban for details.
@@ -15,6 +15,18 @@
 
 import unittest
 import os
+import sys
+
+# If run directly as a script, add Thuban's test directory, the Lib
+# directory and the Thuban directory itself to the path.
+# Otherwise we assume that the importing code as already done it
+if __name__ == "__main__":
+    sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),
+                                 "..", "..", "..", "test"))
+    sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),
+                                 "..", "..", "..", "Lib"))
+    sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),
+                                 "..", "..", ".."))
 
 import support
 import shapelib





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)