[Thuban-commits] r2720 - in trunk/thuban: . Extensions/export_shapefile

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jan 8 17:57:37 CET 2007


Author: dpinte
Date: 2007-01-08 17:57:36 +0100 (Mon, 08 Jan 2007)
New Revision: 2720

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Extensions/export_shapefile/export_shapefile.py
Log:
2007-01-08 Didrik Pinte <dpinte at itae.be>

       export_shapefile extension migrated to wxPython 2.6

       * Extensions/export_shapefile/export_shapefile.py:
       updated wx statements, changed the FileDialog to wx.SAVE (was wx.OPEN)




Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2007-01-08 16:30:29 UTC (rev 2719)
+++ trunk/thuban/ChangeLog	2007-01-08 16:57:36 UTC (rev 2720)
@@ -1,5 +1,12 @@
 2007-01-08 Didrik Pinte <dpinte at itae.be>
 	
+	export_shapefile extension migrated to wxPython 2.6
+
+	* Extensions/export_shapefile/export_shapefile.py: 
+	updated wx statements, changed the FileDialog to wx.SAVE (was wx.OPEN)
+
+2007-01-08 Didrik Pinte <dpinte at itae.be>
+	
 	umn_mapserver extension migrated to wxPython 2.6
 
 	* Extensions/umn_maserver/

Modified: trunk/thuban/Extensions/export_shapefile/export_shapefile.py
===================================================================
--- trunk/thuban/Extensions/export_shapefile/export_shapefile.py	2007-01-08 16:30:29 UTC (rev 2719)
+++ trunk/thuban/Extensions/export_shapefile/export_shapefile.py	2007-01-08 16:57:36 UTC (rev 2720)
@@ -14,8 +14,7 @@
 # $Source$
 # $Id$
 
-from wxPython.wx import wxFileDialog, wxOPEN, wxOVERWRITE_PROMPT, wxID_OK, \
-     wxProgressDialog
+import wx
 
 from Thuban.Model.data import SHAPETYPE_POLYGON, SHAPETYPE_ARC, \
                               SHAPETYPE_POINT
@@ -40,11 +39,11 @@
        return
 
     # Second, get the basefilename for the shapefile.
-    dlg = wxFileDialog(context.mainwindow,
+    dlg = wx.FileDialog(context.mainwindow,
                        _('Export Shapefile'), '.', '',
                        _('Shapefile  Files (*.shp)|*.shp|'),
-                       wxOPEN|wxOVERWRITE_PROMPT)
-    if dlg.ShowModal() == wxID_OK:
+                       wx.SAVE|wx.OVERWRITE_PROMPT)
+    if dlg.ShowModal() == wx.ID_OK:
         filename = dlg.GetPath()[:-4]
         dlg.Destroy()
     else:
@@ -64,7 +63,7 @@
     shp = shapelib.create(shp_filename, shapetypes[layer.ShapeType()])
 
     # Now go through all shapes and store them to the file
-    dlg= wxProgressDialog(_("Export Shapefile"),
+    dlg= wx.ProgressDialog(_("Export Shapefile"),
                           _("Storing shapes ..."),
                           layer.ShapeStore().NumShapes(),
                           None)



More information about the Thuban-commits mailing list