[Thuban-commits] r2785 - in trunk/thuban: . Extensions/wms

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 28 00:39:51 CET 2007


Author: bernhard
Date: 2007-11-28 00:39:49 +0100 (Wed, 28 Nov 2007)
New Revision: 2785

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Extensions/wms/infodialog.py
   trunk/thuban/Extensions/wms/layer.py
   trunk/thuban/Extensions/wms/properties.py
   trunk/thuban/Extensions/wms/wms.py
Log:
Wms-Extension: some fixes in order to make it work again.

* Extensions/wms/infodialog.py(calcText()): removed encode('latin1')
as the Title already should be in the internal Thuban encoding.

*  Extensions/wms/properties.py:  removed encode('latin1')
as the Title already should be in the internal Thuban encoding.
Added copyright year 2007. Fixed reference to wx.EVT_BUTTON.

* Extensions/wms/layer.py: Using internal_from_.unicode now to bring
 the layer title in the right encoding.


* Extensions/wms/wms.py: adapting call to draw_raster_layer as
draw_raster_layer() got the calling parameters changed in rev2618.
Changed the preset selection choice towards demo.intevation.org, as
the frida wms does not seem to work anymore these days.
Fixed reference to EVT_BUTTON (was probably an oversight from the wx2.6
migration.)


Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2007-11-26 00:15:50 UTC (rev 2784)
+++ trunk/thuban/ChangeLog	2007-11-27 23:39:49 UTC (rev 2785)
@@ -1,3 +1,25 @@
+2007-11-28   Bernhard Reiter <bernhard at intevation.de>
+
+	Wms-Extension: some fixes in order to make it work again.
+
+	* Extensions/wms/infodialog.py(calcText()): removed encode('latin1')
+	as the Title already should be in the internal Thuban encoding.
+
+	*  Extensions/wms/properties.py:  removed encode('latin1')
+        as the Title already should be in the internal Thuban encoding.
+	Added copyright year 2007. Fixed reference to wx.EVT_BUTTON.
+
+	* Extensions/wms/layer.py: Using internal_from_.unicode now to bring
+	 the layer title in the right encoding.
+
+
+	* Extensions/wms/wms.py: adapting call to draw_raster_layer as
+ 	draw_raster_layer() got the calling parameters changed in rev2618.
+	Changed the preset selection choice towards demo.intevation.org, as
+	the frida wms does not seem to work anymore these days.
+	Fixed reference to EVT_BUTTON (was probably an oversight from the wx2.6
+	migration.)
+
 2007-11-26  Bernhard Reiter <bernhard at intevation.de>
 
 	* README: Added remark that extension can have their own

Modified: trunk/thuban/Extensions/wms/infodialog.py
===================================================================
--- trunk/thuban/Extensions/wms/infodialog.py	2007-11-26 00:15:50 UTC (rev 2784)
+++ trunk/thuban/Extensions/wms/infodialog.py	2007-11-27 23:39:49 UTC (rev 2785)
@@ -98,7 +98,7 @@
 
         foo = layer.capabilities.getTitle()
         if foo != "":
-            text += foo.encode('latin1') + "\n\n"
+            text += foo + "\n\n"
 
         foo = layer.capabilities.getAbstract()
         if foo != "":

Modified: trunk/thuban/Extensions/wms/layer.py
===================================================================
--- trunk/thuban/Extensions/wms/layer.py	2007-11-26 00:15:50 UTC (rev 2784)
+++ trunk/thuban/Extensions/wms/layer.py	2007-11-27 23:39:49 UTC (rev 2785)
@@ -1,4 +1,4 @@
-# Copyright (c) 2003, 2004 by Intevation GmbH
+# Copyright (c) 2003, 2004, 2007 by Intevation GmbH
 # Authors:
 # Jan-Oliver Wagner <jan at intevation.de>
 # Martin Schulze <joey at infodrom.org>
@@ -52,6 +52,7 @@
 # $Id$
 
 
+from Thuban import internal_from_unicode
 from Thuban.Model.layer import BaseLayer
 from Thuban.Model.resource import get_system_proj_file, EPSG_PROJ_FILE, \
      EPSG_DEPRECATED_PROJ_FILE
@@ -163,7 +164,7 @@
             return
 
         # get and set the title
-        self.SetTitle(self.capabilities.getTitle().encode('latin1', 'replace'))
+        self.SetTitle(internal_from_unicode(self.capabilities.getTitle()))
 
 
     def LatLongBoundingBox(self):

Modified: trunk/thuban/Extensions/wms/properties.py
===================================================================
--- trunk/thuban/Extensions/wms/properties.py	2007-11-26 00:15:50 UTC (rev 2784)
+++ trunk/thuban/Extensions/wms/properties.py	2007-11-27 23:39:49 UTC (rev 2785)
@@ -1,4 +1,4 @@
-# Copyright (c) 2004 by Intevation GmbH
+# Copyright (c) 2004, 2007 by Intevation GmbH
 # Authors:
 # Martin Schulze <joey at infodrom.org>
 #
@@ -115,7 +115,7 @@
         vbox.Add(lbox, 0, wx.ALL, 0)
         visible = layer.getVisibleLayers()
         for l in layer.getLayers():
-            checker = wx.CheckBox(self, ID_WMS_LAYER, layer.getLayerTitle(l)[0:MAX_LAYERNAME_LENGTH].encode('latin1'))
+            checker = wx.CheckBox(self, ID_WMS_LAYER, layer.getLayerTitle(l)[0:MAX_LAYERNAME_LENGTH])
             self.layers[l] = checker
             if l in visible:
                 checker.SetValue(True)
@@ -151,8 +151,8 @@
         hbox.Add(buttons, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 0)
         buttons.Add(wx.Button(self, wx.ID_OK, _("OK")), 0, wx.ALL, 4)
         buttons.Add(wx.Button(self, wx.ID_CANCEL, _("Cancel")), 0, wx.ALL, 4)
-        EVT_BUTTON(self, wx.ID_OK, self.OnOK)
-        EVT_BUTTON(self, wx.ID_CANCEL, self.OnCancel)
+        wx.EVT_BUTTON(self, wx.ID_OK, self.OnOK)
+        wx.EVT_BUTTON(self, wx.ID_CANCEL, self.OnCancel)
 
         self.SetAutoLayout(True)
         self.SetSizer(mainbox)

Modified: trunk/thuban/Extensions/wms/wms.py
===================================================================
--- trunk/thuban/Extensions/wms/wms.py	2007-11-26 00:15:50 UTC (rev 2784)
+++ trunk/thuban/Extensions/wms/wms.py	2007-11-27 23:39:49 UTC (rev 2785)
@@ -57,7 +57,7 @@
 
     data = (width, height, (img, None, None))
 
-    renderer.draw_raster_data(layer, 0,0, data, format)
+    renderer.draw_raster_data(0,0, data, format)
 
     return ()
 
@@ -78,7 +78,7 @@
 
         self.combo_value = wx.ComboBox(self, self.ID_COMBOVALUE, size=(500,-1))
         self.combo_value.Append("")
-        self.combo_value.Append('http://frida.intevation.org/cgi-bin/frida_wms?')
+        self.combo_value.Append('http://demo.intevation.org/cgi-bin/frida-wms?')
         #self.combo_value.Append('http://wms.jpl.nasa.gov/wms.cgi?')
         #self.combo_value.Append('http://eukrante.hq:9089/cgi-bin/wms_shg?')
         #self.combo_value.Append('http://131.220.106.112:8080/deegree0.7/wms?')
@@ -102,8 +102,8 @@
         vbox.SetSizeHints(self)
         self.Layout()
 
-        EVT_BUTTON(self, wx.ID_OK, self.OnOK)
-        EVT_BUTTON(self, wx.ID_CANCEL, self.OnCancel)
+        wx.EVT_BUTTON(self, wx.ID_OK, self.OnOK)
+        wx.EVT_BUTTON(self, wx.ID_CANCEL, self.OnCancel)
 
     def OnOK(self, event):
         self.url = self.combo_value.GetValue()



More information about the Thuban-commits mailing list