/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/tableview.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/tableview.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1026 by jan, Fri May 23 09:18:28 2003 UTC revision 1027 by frank, Mon May 26 11:47:17 2003 UTC
# Line 7  Line 7 
7    
8  __version__ = "$Revision$"  __version__ = "$Revision$"
9    
10    import os.path
11    
12  from Thuban import _  from Thuban import _
13    
14  from wxPython.wx import *  from wxPython.wx import *
# Line 14  from wxPython.grid import * Line 16  from wxPython.grid import *
16    
17  from Thuban.Lib.connector import Publisher  from Thuban.Lib.connector import Publisher
18  from Thuban.Model.table import FIELDTYPE_INT, FIELDTYPE_DOUBLE, \  from Thuban.Model.table import FIELDTYPE_INT, FIELDTYPE_DOUBLE, \
19       FIELDTYPE_STRING       FIELDTYPE_STRING, table_to_dbf, table_to_csv
20  import view  import view
21  from dialogs import NonModalDialog  from dialogs import NonModalDialog
22  from messages import SHAPES_SELECTED  from messages import SHAPES_SELECTED
# Line 392  class QueryTableFrame(TableFrame): Line 394  class QueryTableFrame(TableFrame):
394                             _("All Files (*.*)|*.*"),                             _("All Files (*.*)|*.*"),
395                             wxSAVE|wxOVERWRITE_PROMPT)                             wxSAVE|wxOVERWRITE_PROMPT)
396          if dlg.ShowModal() == wxID_OK:          if dlg.ShowModal() == wxID_OK:
397              pass              filename = dlg.GetPath()
398                                                                                                type = os.path.basename(filename).split('.')[-1:][0]
399          dlg.Destroy()              dlg.Destroy()
400                if type.upper() == "DBF":
401                    table_to_dbf(self.table, filename)
402                elif type.upper() == 'CSV':
403                    table_to_csv(self.table, filename)
404                else:
405                    dlg = wxMessageDialog(None, "Unsupported format: %s" % type,
406                                          "Table Export", wxOK|wxICON_WARNING)
407                    dlg.ShowModal()
408                    dlg.Destroy()
409            else:
410                dlg.Destroy()
411    
412      def OnClose(self, event):      def OnClose(self, event):
413          TableFrame.OnClose(self, event)          TableFrame.OnClose(self, event)

Legend:
Removed from v.1026  
changed lines
  Added in v.1027

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26