[Python-modules-commits] r1865 - in /packages/python-dsv/trunk/debian: changelog patches/02-wx-namespace-transition.patch

ucko at users.alioth.debian.org ucko at users.alioth.debian.org
Wed Mar 7 19:39:56 CET 2007


Author: ucko
Date: Wed Mar  7 18:39:56 2007
New Revision: 1865

URL: http://svn.debian.org/wsvn/python-modules/?sc=1&rev=1865
Log:
debian/patches/02-wx-namespace-transition.patch (new, via Joe Pham
<djpham at bitpim.org>): use the modern wx package rather than the
clunkier wxPython package, which wxWidgets 2.8 will no longer provide.

Added:
    packages/python-dsv/trunk/debian/patches/02-wx-namespace-transition.patch
Modified:
    packages/python-dsv/trunk/debian/changelog

Modified: packages/python-dsv/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/python-modules/packages/python-dsv/trunk/debian/changelog?rev=1865&op=diff
==============================================================================
--- packages/python-dsv/trunk/debian/changelog (original)
+++ packages/python-dsv/trunk/debian/changelog Wed Mar  7 18:39:56 2007
@@ -5,7 +5,12 @@
   [Piotr Ożarowski]
   * Fix typo in XS-Vcs-Svn: control field (misconverted from +ssh version)
 
- -- Aaron M. Ucko <ucko at debian.org>  Wed, 28 Feb 2007 17:55:48 -0500
+  [Aaron M. Ucko]
+  * debian/patches/02-wx-namespace-transition.patch (new, via Joe Pham
+    <djpham at bitpim.org>): use the modern wx package rather than the
+    clunkier wxPython package, which wxWidgets 2.8 will no longer provide.
+
+ -- Aaron M. Ucko <ucko at debian.org>  Wed,  7 Mar 2007 13:38:40 -0500
 
 python-dsv (1.4.0-4) unstable; urgency=low
 

Added: packages/python-dsv/trunk/debian/patches/02-wx-namespace-transition.patch
URL: http://svn.debian.org/wsvn/python-modules/packages/python-dsv/trunk/debian/patches/02-wx-namespace-transition.patch?rev=1865&op=file
==============================================================================
--- packages/python-dsv/trunk/debian/patches/02-wx-namespace-transition.patch (added)
+++ packages/python-dsv/trunk/debian/patches/02-wx-namespace-transition.patch Wed Mar  7 18:39:56 2007
@@ -1,0 +1,434 @@
+diff -Nur python-dsv-1.4.0/DSV/DSV.py python-dsv-1.4.0.new/DSV/DSV.py
+--- python-dsv-1.4.0/DSV/DSV.py	2007-03-06 20:04:46.569562161 -0500
++++ python-dsv-1.4.0.new/DSV/DSV.py	2007-03-06 20:05:05.755362392 -0500
+@@ -2,6 +2,9 @@
+ DSV.py - Cliff Wells, 2002
+   Import/export DSV (delimiter separated values, a generalization of CSV).
+ 
++2007-01-09: Modified by Joe Pham <djpham at bitpim.org> to accommodate
++            wxPython 2.8+
++
+ Basic use:
+ 
+    from DSV import DSV
+@@ -123,8 +126,14 @@
+ # import os
+ # os.putenv('LANG', 'C')
+ 
++##try:
++##    from wxPython import wx, grid
++##except ImportError:
++##    wx = None
++
+ try:
+-    from wxPython import wx, grid
++    import wx
++    import wx.grid as gridlib
+ except ImportError:
+     wx = None
+ 
+@@ -602,19 +611,19 @@
+ 
+ if wx is not None:
+     # ------------------------------------------------------------------------------
+-    class ImportWizardPanel_Delimiters(wx.wxPanel):
++    class ImportWizardPanel_Delimiters(wx.Panel):
+         """
+         CLASS(SUPERCLASS):
+-          ImportWizardPanel_Delimiters(wx.wxPanel)
++          ImportWizardPanel_Delimiters(wx.Panel)
+         DESCRIPTION:
+-          A wx.wxPanel that provides a basic interface for validating and changing the
++          A wx.Panel that provides a basic interface for validating and changing the
+           parameters for importing a delimited text file. Similar to MS Excel's
+           CSV import wizard. Can be used in a series of wizards or embedded in an
+           application.
+         PROTOTYPE:
+           ImportWizardPanel_Delimiters(parent, id, file, data, isValidCallback = None,
+-                                       pos = wx.wxDefaultPosition, size = wx.wxDefaultSize,
+-                                       style = wx.wxTAB_TRAVERSAL, name = 'ImportWizardPanel')
++                                       pos = wx.DefaultPosition, size = wx.DefaultSize,
++                                       style = wx.TAB_TRAVERSAL, name = 'ImportWizardPanel')
+         ARGUMENTS:
+           - parent is the parent window
+           - id is the id of this wizard panel
+@@ -634,24 +643,24 @@
+         """
+ 
+         def __init__(self, parent, id, file, data, isValidCallback = None,
+-                     pos = wx.wxDefaultPosition, size = wx.wxDefaultSize,
+-                     style = wx.wxTAB_TRAVERSAL, name = "ImportWizardPanel"):
+-            wx.wxPanel.__init__(self, parent, id, pos, size, style, name)
+-            self.SetAutoLayout(wx.true)
+-            mainSizer = wx.wxFlexGridSizer(3, 1)
++                     pos = wx.DefaultPosition, size = wx.DefaultSize,
++                     style = wx.TAB_TRAVERSAL, name = "ImportWizardPanel"):
++            wx.Panel.__init__(self, parent, id, pos, size, style, name)
++            self.SetAutoLayout(True)
++            mainSizer = wx.FlexGridSizer(3, 1)
+             self.SetSizer(mainSizer)
+             mainSizer.AddGrowableCol(0)
+ 
+-            self.initialized = wx.false
++            self.initialized = False
+             self.data = data
+             self.isValidCallback = isValidCallback
+             self.Validate = (isValidCallback and self.Validate) or self.BuildPreview
+ 
+-            dlg = wx.wxProgressDialog("Import Wizard",
++            dlg = wx.ProgressDialog("Import Wizard",
+                                    "Analyzing %s... Please wait." % file,
+                                    3,
+                                    parent,
+-                                   wx.wxPD_APP_MODAL | wx.wxPD_AUTO_HIDE)
++                                   wx.PD_APP_MODAL | wx.PD_AUTO_HIDE)
+             textQualifier = guessTextQualifier(data)
+             dlg.Update(1)
+             newdata = organizeIntoLines(data, textQualifier = textQualifier, limit = 100)
+@@ -663,13 +672,13 @@
+             # -------------
+             msg = ("This screen lets you set the delimiters your data contains.\n"
+                    "You can see how your data is affected in the preview below.")
+-            message1 = wx.wxStaticText(self, -1, msg)
++            message1 = wx.StaticText(self, -1, msg)
+ 
+             # -------------
+-            delimiterBox = wx.wxBoxSizer(wx.wxHORIZONTAL)
+-            delimStaticBox = wx.wxStaticBox(self, -1, "Delimiters")
+-            delimStaticSizer = wx.wxStaticBoxSizer(delimStaticBox, wx.wxVERTICAL)
+-            delimGridSizer = wx.wxFlexGridSizer(2, 3)
++            delimiterBox = wx.BoxSizer(wx.HORIZONTAL)
++            delimStaticBox = wx.StaticBox(self, -1, "Delimiters")
++            delimStaticSizer = wx.StaticBoxSizer(delimStaticBox, wx.VERTICAL)
++            delimGridSizer = wx.FlexGridSizer(2, 3)
+ 
+             delims = {
+                 'Tab':       '\t',
+@@ -681,36 +690,36 @@
+             self.delimChecks = {}
+ 
+             for label, value in delims.items():
+-                self.delimChecks[value] = wx.wxCheckBox(self, -1, label)
+-                delimGridSizer.Add(self.delimChecks[value], 0, wx.wxALL, 3)
++                self.delimChecks[value] = wx.CheckBox(self, -1, label)
++                delimGridSizer.Add(self.delimChecks[value], 0, wx.ALL, 3)
+                 wx.EVT_CHECKBOX(self, self.delimChecks[value].GetId(), self.Validate)
+ 
+-            otherSizer = wx.wxBoxSizer(wx.wxHORIZONTAL)
++            otherSizer = wx.BoxSizer(wx.HORIZONTAL)
+ 
+-            self.delimChecks['Other'] = wx.wxCheckBox(self, -1, 'Other:')
++            self.delimChecks['Other'] = wx.CheckBox(self, -1, 'Other:')
+             wx.EVT_CHECKBOX(self, self.delimChecks['Other'].GetId(), self.Validate)
+ 
+-            self.otherDelim = wx.wxTextCtrl(self, -1, size = (20, -1))
++            self.otherDelim = wx.TextCtrl(self, -1, size = (20, -1))
+             wx.EVT_TEXT(self, self.otherDelim.GetId(), self.OnCustomDelim)
+ 
+             if self.delimChecks.has_key(delimiter):
+-                self.delimChecks[delimiter].SetValue(wx.true)
++                self.delimChecks[delimiter].SetValue(True)
+             elif delimiter is not None:
+-                self.delimChecks['Other'].SetValue(wx.true)
++                self.delimChecks['Other'].SetValue(True)
+                 self.otherDelim.SetValue(delimiter)
+ 
+             otherSizer.AddMany([
+-                (self.delimChecks['Other'], 0, wx.wxALL, 3),
+-                (self.otherDelim, 0, wx.wxALIGN_CENTER),
++                (self.delimChecks['Other'], 0, wx.ALL, 3),
++                (self.otherDelim, 0, wx.ALIGN_CENTER),
+                 ])
+             
+             delimGridSizer.Add(otherSizer)
+-            delimStaticSizer.Add(delimGridSizer, 1, wx.wxEXPAND)
+-            delimOtherSizer = wx.wxBoxSizer(wx.wxVERTICAL)
+-            self.consecutiveDelimsAs1 = wx.wxCheckBox(self, -1, "Treat consecutive delimiters as one")
+-            self.consecutiveDelimsAs1.Enable(wx.false)
+-            tqSizer = wx.wxBoxSizer(wx.wxHORIZONTAL)
+-            self.textQualifierChoice = wx.wxChoice(self, -1, choices = ['"', "'", "{None}"])
++            delimStaticSizer.Add(delimGridSizer, 1, wx.EXPAND)
++            delimOtherSizer = wx.BoxSizer(wx.VERTICAL)
++            self.consecutiveDelimsAs1 = wx.CheckBox(self, -1, "Treat consecutive delimiters as one")
++            self.consecutiveDelimsAs1.Enable(False)
++            tqSizer = wx.BoxSizer(wx.HORIZONTAL)
++            self.textQualifierChoice = wx.Choice(self, -1, choices = ['"', "'", "{None}"])
+             wx.EVT_CHOICE(self, self.textQualifierChoice.GetId(), self.BuildPreview)
+             if textQualifier is not None:
+                 self.textQualifierChoice.SetStringSelection(textQualifier)
+@@ -718,52 +727,52 @@
+                 self.textQualifierChoice.SetStringSelection('{None}')
+                 
+             tqSizer.AddMany([
+-                (wx.wxStaticText(self, -1, "Text qualifier:"), 0, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL),
+-                (self.textQualifierChoice, 0, wx.wxALL | wx.wxALIGN_LEFT | wx.wxALIGN_CENTER_VERTICAL, 5),
++                (wx.StaticText(self, -1, "Text qualifier:"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL),
++                (self.textQualifierChoice, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5),
+                 ])
+             
+             delimOtherSizer.AddMany([
+-                (self.consecutiveDelimsAs1, 1, wx.wxEXPAND | wx.wxALL, 5),
+-                (tqSizer, 1, wx.wxALL | wx.wxALIGN_CENTER, 5),
++                (self.consecutiveDelimsAs1, 1, wx.EXPAND | wx.ALL, 5),
++                (tqSizer, 1, wx.ALL | wx.ALIGN_CENTER, 5),
+                 ])
+ 
+             delimiterBox.AddMany([
+-                (delimStaticSizer, 0, wx.wxALIGN_CENTER),
+-                (delimOtherSizer,  0, wx.wxALIGN_CENTER),
++                (delimStaticSizer, 0, wx.ALIGN_CENTER),
++                (delimOtherSizer,  0, wx.ALIGN_CENTER),
+                 ])
+             
+             delimStaticBox.Fit()
+ 
+             # -------------
+             self.displayRows = 6
+-            previewSettingsBox = wx.wxBoxSizer(wx.wxHORIZONTAL)
+-            self.hasHeaderRow = wx.wxCheckBox(self, -1, "First row is header")
++            previewSettingsBox = wx.BoxSizer(wx.HORIZONTAL)
++            self.hasHeaderRow = wx.CheckBox(self, -1, "First row is header")
+             wx.EVT_CHECKBOX(self, self.hasHeaderRow.GetId(), self.BuildPreview)
+ 
+-            if wx.wxPlatform in ('__WX.WXGTK__', '__WX.WXMSW__'):
+-                # wx.wxSpinCtrl causes seg fault under GTK when <enter> is hit in text - use wx.wxSpinButton instead
+-                self.previewRowsText = wx.wxTextCtrl(self, -1, str(self.displayRows),
+-                                                  size = (30, -1), style = wx.wxTE_PROCESS_ENTER)
++            if wx.Platform in ('__WX.WXGTK__', '__WX.WXMSW__'):
++                # wx.SpinCtrl causes seg fault under GTK when <enter> is hit in text - use wx.SpinButton instead
++                self.previewRowsText = wx.TextCtrl(self, -1, str(self.displayRows),
++                                                  size = (30, -1), style = wx.TE_PROCESS_ENTER)
+                 h = self.previewRowsText.GetSize().height
+-                self.previewRows = wx.wxSpinButton(self, -1, size = (-1, h), style = wx.wxSP_VERTICAL)
++                self.previewRows = wx.SpinButton(self, -1, size = (-1, h), style = wx.SP_VERTICAL)
+                 self.previewRows.SetRange(self.displayRows, 100)
+                 self.previewRows.SetValue(self.displayRows)
+                 wx.EVT_SPIN(self, self.previewRows.GetId(), self.OnSpinPreviewRows)
+                 wx.EVT_TEXT_ENTER(self, self.previewRowsText.GetId(), self.OnTextPreviewRows)
+             else:
+-                self.previewRows = wx.wxSpinCtrl(self, -1, str(self.displayRows),
++                self.previewRows = wx.SpinCtrl(self, -1, str(self.displayRows),
+                                               min = self.displayRows, max = 100, size = (50, -1))
+                 wx.EVT_SPINCTRL(self, self.previewRows.GetId(), self.BuildPreview)
+ 
+             previewSettingsBox.AddMany([
+-                (self.hasHeaderRow, 1, wx.wxALL | wx.wxEXPAND, 5),
+-                (wx.wxStaticText(self, -1, "Preview"), 0, wx.wxWEST | wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL, 10),
++                (self.hasHeaderRow, 1, wx.ALL | wx.EXPAND, 5),
++                (wx.StaticText(self, -1, "Preview"), 0, wx.WEST | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 10),
+                 ])
+-            if wx.wxPlatform in ('__WX.WXGTK__', '__WX.WXMSW__'):
+-                previewSettingsBox.Add(self.previewRowsText, 0, wx.wxALIGN_CENTER | wx.wxALL, 3)
++            if wx.Platform in ('__WX.WXGTK__', '__WX.WXMSW__'):
++                previewSettingsBox.Add(self.previewRowsText, 0, wx.ALIGN_CENTER | wx.ALL, 3)
+             previewSettingsBox.AddMany([
+-                (self.previewRows, 0, wx.wxALIGN_CENTER | wx.wxALL, 3),
+-                (wx.wxStaticText(self, -1, "rows"), 0, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL),
++                (self.previewRows, 0, wx.ALIGN_CENTER | wx.ALL, 3),
++                (wx.StaticText(self, -1, "rows"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL),
+                 ])
+ 
+             # -------------
+@@ -781,28 +790,28 @@
+                 hasHeaders = 0
+                 cols = 1
+ 
+-            previewStaticBox = wx.wxStaticBox(self, -1, "Data Preview")
+-            previewStaticSizer = wx.wxStaticBoxSizer(previewStaticBox, wx.wxVERTICAL)
+-            self.preview = grid.wxGrid(self, -1)
++            previewStaticBox = wx.StaticBox(self, -1, "Data Preview")
++            previewStaticSizer = wx.StaticBoxSizer(previewStaticBox, wx.VERTICAL)
++            self.preview = gridlib.Grid(self, -1)
+             self.preview.CreateGrid(self.displayRows, cols)
+-            self.preview.SetDefaultRowSize(self.preview.GetCharHeight() + 4, wx.true)
+-            self.preview.EnableEditing(wx.false)
++            self.preview.SetDefaultRowSize(self.preview.GetCharHeight() + 4, True)
++            self.preview.EnableEditing(False)
+             self.preview.SetColLabelSize(0)
+             self.preview.SetRowLabelSize(0)
+             self.preview.SetMargins(1, 0)
+-            self.initialized = wx.true
++            self.initialized = True
+             self.BuildPreview()
+ 
+             rowheight = self.preview.GetRowSize(0) + 2
+             self.preview.SetSize((-1, rowheight * self.displayRows))
+-            previewStaticSizer.Add(self.preview, 0, wx.wxALL | wx.wxEXPAND, 5)
++            previewStaticSizer.Add(self.preview, 0, wx.ALL | wx.EXPAND, 5)
+ 
+             # -------------
+             mainSizer.AddMany([
+-                (message1,     0, wx.wxALL, 5),
+-                (delimiterBox, 0, wx.wxALL, 5),
+-                (previewSettingsBox, 0, wx.wxALL, 5),
+-                (previewStaticSizer, 0, wx.wxALL | wx.wxEXPAND, 5),
++                (message1,     0, wx.ALL, 5),
++                (delimiterBox, 0, wx.ALL, 5),
++                (previewSettingsBox, 0, wx.ALL, 5),
++                (previewStaticSizer, 0, wx.ALL | wx.EXPAND, 5),
+                 ])
+ 
+             self.Layout()
+@@ -832,9 +841,9 @@
+             if not self.initialized:
+                 return # got triggered before initialization was completed
+ 
+-            if wx.wxPlatform != '__WX.WXGTK__':
+-                wx.wxBeginBusyCursor() # causes a spurious spin event under GTK
+-            wx.wxYield() # allow controls to update first, in case of slow preview
++            if wx.Platform != '__WX.WXGTK__':
++                wx.BeginBusyCursor() # causes a spurious spin event under GTK
++            wx.Yield() # allow controls to update first, in case of slow preview
+             self.preview.BeginBatch()
+             self.preview.DeleteCols(0, self.preview.GetNumberCols())
+             self.preview.DeleteRows(0, self.preview.GetNumberRows())
+@@ -869,7 +878,7 @@
+                 for col in range(cols):
+                     try:    self.preview.SetColLabelValue(col, str(previewData[0][col]))
+                     except: self.preview.SetColLabelValue(col, "")
+-                # self.preview.AutoSizeColumns(wx.true) # size columns to headers
++                # self.preview.AutoSizeColumns(True) # size columns to headers
+             else:
+                 self.preview.SetColLabelSize(0)
+ 
+@@ -879,13 +888,13 @@
+                     except: pass
+ 
+             # if not hasHeaders:
+-            self.preview.AutoSizeColumns(wx.true) # size columns to data
++            self.preview.AutoSizeColumns(True) # size columns to data
+ 
+             rowheight = self.preview.GetRowSize(0)
+             self.preview.SetRowSize(0, rowheight)
+             self.preview.EndBatch()
+-            if wx.wxPlatform != '__WX.WXGTK__':
+-                wx.wxEndBusyCursor()
++            if wx.Platform != '__WX.WXGTK__':
++                wx.EndBusyCursor()
+ 
+             self.delimiters = delimiter
+             self.textQualifier = textQualifier
+@@ -905,17 +914,17 @@
+             return self.hasHeaders
+ 
+     # ------------------------------------------------------------------------------        
+-    class ImportWizardDialog(wx.wxDialog):
++    class ImportWizardDialog(wx.Dialog):
+         """
+         CLASS(SUPERCLASS):
+-          ImportWizardDialog(wx.wxDialog)
++          ImportWizardDialog(wx.Dialog)
+         DESCRIPTION:
+           A dialog allowing the user to preview and change the options for importing
+           a file.
+         PROTOTYPE:
+           ImportWizardDialog(parent, id, title, file,
+-                             pos = wx.wxDefaultPosition, size = wx.wxDefaultSize,
+-                             style = wx.wxDEFAULT_DIALOG_STYLE, name = 'ImportWizardDialog')
++                             pos = wx.DefaultPosition, size = wx.DefaultSize,
++                             style = wx.DEFAULT_DIALOG_STYLE, name = 'ImportWizardDialog')
+         ARGUMENTS:
+           - parent: the parent window
+           - id: the id of this window
+@@ -932,22 +941,22 @@
+         """
+ 
+         def __init__(self, parent, id, title, file,
+-                     pos = wx.wxDefaultPosition, size = wx.wxDefaultSize,
+-                     style = wx.wxDEFAULT_DIALOG_STYLE, name = "ImportWizardDialog"):
+-            wx.wxDialog.__init__(self, parent, id, title, pos, size, style, name)
+-            self.SetAutoLayout(wx.true)
++                     pos = wx.DefaultPosition, size = wx.DefaultSize,
++                     style = wx.DEFAULT_DIALOG_STYLE, name = "ImportWizardDialog"):
++            wx.Dialog.__init__(self, parent, id, title, pos, size, style, name)
++            self.SetAutoLayout(True)
+ 
+             self.file = file
+             f = open(file, 'r')
+             self.data = f.read()
+             f.close()
+ 
+-            sizer = wx.wxBoxSizer(wx.wxVERTICAL)
++            sizer = wx.BoxSizer(wx.VERTICAL)
+             self.delimPanel = ImportWizardPanel_Delimiters(self, -1, file, self.data, self.ValidState)
+             buttonBox = self.ButtonBox()
+             sizer.AddMany([
+-                (self.delimPanel, 0, wx.wxALL, 5),
+-                (buttonBox, 0, wx.wxSOUTH | wx.wxALIGN_CENTER_HORIZONTAL | wx.wxALIGN_TOP, 0),
++                (self.delimPanel, 0, wx.ALL, 5),
++                (buttonBox, 0, wx.SOUTH | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_TOP, 0),
+                 ])
+ 
+             self.SetSizer(sizer)
+@@ -957,15 +966,15 @@
+             self.Centre()
+ 
+         def ButtonBox(self):
+-            panel = wx.wxPanel(self, -1)
+-            panel.SetAutoLayout(wx.true)
+-            sizer = wx.wxBoxSizer(wx.wxHORIZONTAL)
++            panel = wx.Panel(self, -1)
++            panel.SetAutoLayout(True)
++            sizer = wx.BoxSizer(wx.HORIZONTAL)
+             panel.SetSizer(sizer)
+-            self.ok = wx.wxButton(panel, wx.wxID_OK, "Ok")
+-            cancel = wx.wxButton(panel, wx.wxID_CANCEL, "Cancel")
++            self.ok = wx.Button(panel, wx.ID_OK, "Ok")
++            cancel = wx.Button(panel, wx.ID_CANCEL, "Cancel")
+             sizer.AddMany([
+-                (self.ok, 0, wx.wxALIGN_TOP | wx.wxEAST | wx.wxSOUTH, 10),
+-                (cancel, 0, wx.wxALIGN_TOP | wx.wxWEST | wx.wxSOUTH, 10),
++                (self.ok, 0, wx.ALIGN_TOP | wx.EAST | wx.SOUTH, 10),
++                (cancel, 0, wx.ALIGN_TOP | wx.WEST | wx.SOUTH, 10),
+                 ])
+             panel.Layout()
+             panel.Fit()
+@@ -979,11 +988,11 @@
+         def ImportData(self, errorHandler = skipRow):
+             delimiters, qualifier, hasHeaders = self.GetImportInfo()
+             self.data = organizeIntoLines(self.data, textQualifier = qualifier)
+-            dlg = wx.wxProgressDialog("Import DSV File",
++            dlg = wx.ProgressDialog("Import DSV File",
+                                    self.file,
+                                    100,
+                                    self,
+-                                   wx.wxPD_CAN_ABORT | wx.wxPD_APP_MODAL | wx.wxPD_AUTO_HIDE)
++                                   wx.PD_CAN_ABORT | wx.PD_APP_MODAL | wx.PD_AUTO_HIDE)
+             self.data = importDSV(self.data,
+                                   delimiter = delimiters,
+                                   textQualifier = qualifier,
+@@ -1011,12 +1020,12 @@
+ 
+ 
+     def demo():
+-        class SampleApp(wx.wxApp):
++        class SampleApp(wx.App):
+             def OnInit(self):
+-                dlg = wx.wxFileDialog(None, "Choose a file", ".", "",
++                dlg = wx.FileDialog(None, "Choose a file", ".", "",
+                                    "CSV files (*.csv)|*.csv|Text files (*.txt)|*.txt|All files (*.*)|*.*",
+-                                   wx.wxOPEN)
+-                if dlg.ShowModal() == wx.wxID_OK:
++                                   wx.OPEN)
++                if dlg.ShowModal() == wx.ID_OK:
+                     path = dlg.GetPath()
+                     dlg.Destroy()
+ 
+@@ -1026,7 +1035,7 @@
+                         file.write(oldrow + '\n')
+ 
+                     dlg = ImportWizardDialog(None, -1, 'CSV Import Wizard (v.%s)' % __version__, path)
+-                    if dlg.ShowModal() == wx.wxID_OK:
++                    if dlg.ShowModal() == wx.ID_OK:
+                         results = dlg.ImportData(errorHandler = logErrors)
+                         dlg.Destroy()
+                         errorLog.close()
+@@ -1051,7 +1060,7 @@
+                 else:
+                     dlg.Destroy()
+ 
+-                return wx.true
++                return True
+ 
+         app = SampleApp()
+         app.MainLoop()




More information about the Python-modules-commits mailing list