[Thuban-commits] r2856 - in trunk/thuban/Extensions/umn_mapserver: . test

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Jul 27 06:51:23 CEST 2008


Author: elachuni
Date: 2008-07-27 06:51:22 +0200 (Sun, 27 Jul 2008)
New Revision: 2856

Modified:
   trunk/thuban/Extensions/umn_mapserver/mapfile.py
   trunk/thuban/Extensions/umn_mapserver/test/test_mapserver.py
Log:
Applying patch #688 (Bugfixes for umn_mapserver extension)



Modified: trunk/thuban/Extensions/umn_mapserver/mapfile.py
===================================================================
--- trunk/thuban/Extensions/umn_mapserver/mapfile.py	2008-07-27 04:48:51 UTC (rev 2855)
+++ trunk/thuban/Extensions/umn_mapserver/mapfile.py	2008-07-27 04:51:22 UTC (rev 2856)
@@ -42,6 +42,7 @@
 from Thuban.Model.classification import ClassGroupDefault, \
                                         ClassGroupSingleton, ClassGroupRange
 
+import mapscript
 from mapscript import layerObj, classObj, colorObj, styleObj, rectObj, symbolObj, \
                       pointObj, lineObj
                       
@@ -84,12 +85,12 @@
 scalebar_style_type = { 0:"0",
                         1:"1" }
 
-scalebar_position_type = { 0:"ul",
-                           1:"lr",
-                           2:"ur",
-                           3:"ll",
-                           6:"uc",
-                           7:"lc"}
+scalebar_position_type = { mapscript.MS_UL:"ul",
+                           mapscript.MS_LR:"lr",
+                           mapscript.MS_UR:"ur",
+                           mapscript.MS_LL:"ll",
+                           mapscript.MS_UC:"uc",
+                           mapscript.MS_LC:"lc"}
 
 layer_status_type = { 0:"OFF",
                       1:"ON",
@@ -1347,7 +1348,7 @@
                 self._initcode, self._epsgcode = self._mfprojstring.split(':')
             else:  
                 self._params = []  
-                self._params = self._mfprojstring.split("+")
+                self._params = [p.strip() for p in self._mfprojstring.split("+")]
                 if self._params[0] == "":
                     self._params.remove("")
 

Modified: trunk/thuban/Extensions/umn_mapserver/test/test_mapserver.py
===================================================================
--- trunk/thuban/Extensions/umn_mapserver/test/test_mapserver.py	2008-07-27 04:48:51 UTC (rev 2855)
+++ trunk/thuban/Extensions/umn_mapserver/test/test_mapserver.py	2008-07-27 04:51:22 UTC (rev 2856)
@@ -18,6 +18,7 @@
 # Import the testmodul from python
 import unittest
 
+import mapscript
 from mapscript import mapObj
 
 # Import  necessary classes from Thuban
@@ -195,7 +196,7 @@
         # or maybe a grafik
         self.eq(testlayer.get_data(), "test")
         # check projection (used the pojection obj a little bit)
-        self.eq(testlayer.get_projection().get_projection(), "+proj=latlong+ellps=clrk66")
+        self.eq(testlayer.get_projection().get_projection(), "+proj=latlong +ellps=clrk66")
         # TYPE POLYGON
         self.eq(testlayer.get_type(), "point")
         testlayer.set_type("circle")
@@ -232,7 +233,7 @@
         """
         testscalebar = MF_Scalebar(self.testMap.scalebar)
         self.eq(testscalebar.get_position(mode="string"),"ll")
-        self.eq(testscalebar.get_position(), 3)
+        self.eq(testscalebar.get_position(), mapscript.MS_LL)
         self.eq(testscalebar.get_intervals(), 4)
         self.eq(testscalebar.get_status(mode="string"), "OFF")
 



More information about the Thuban-commits mailing list