* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-dsv/files/, dev-python/python-dsv/
@ 2016-11-29 20:45 Pacho Ramos
0 siblings, 0 replies; 2+ messages in thread
From: Pacho Ramos @ 2016-11-29 20:45 UTC (permalink / raw
To: gentoo-commits
commit: e0080102e0e227828b70549f64f70d485622d723
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 29 20:34:07 2016 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Tue Nov 29 20:45:31 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0080102
dev-python/python-dsv: Apply Debian patches also fixing wxpython3 compat (#601178)
Package-Manager: portage-2.3.2
.../python-dsv/files/python-dsv-1.4.1-env.patch | 21 +
.../files/python-dsv-1.4.1-unicode.patch | 21 +
.../files/python-dsv-1.4.1-wx-namespace.patch | 435 +++++++++++++++++++++
.../files/python-dsv-1.4.1-wxpython30.patch | 21 +
.../files/python-dsv-1.4.1-wxversion.patch | 4 +-
dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild | 30 ++
6 files changed, 530 insertions(+), 2 deletions(-)
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-env.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-env.patch
new file mode 100644
index 00000000..c2e7aee
--- /dev/null
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-env.patch
@@ -0,0 +1,21 @@
+Index: python-dsv-1.4.1/DSV/DSV.py
+===================================================================
+--- python-dsv-1.4.1.orig/DSV/DSV.py 2003-08-09 06:37:32.000000000 -0400
++++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:38:02.000000000 -0500
+@@ -127,11 +127,11 @@
+ import copy
+ import exceptions
+ import string
+-# RedHat 8.0 (or rather GTK2?) sets LANG = en_us.UTF-8 and apparently some
+-# older apps (including wxGTK) can't handle this. The fix is to set LANG=C
+-# before running the app. Thanks to Ahmad Baitalmal for supplying this info.
+-import os
+-os.putenv('LANG', 'C')
++## RedHat 8.0 (or rather GTK2?) sets LANG = en_us.UTF-8 and apparently some
++## older apps (including wxGTK) can't handle this. The fix is to set LANG=C
++## before running the app. Thanks to Ahmad Baitalmal for supplying this info.
++# import os
++# os.putenv('LANG', 'C')
+
+ try:
+ from wxPython import wx, grid
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-unicode.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-unicode.patch
new file mode 100644
index 00000000..39faebe
--- /dev/null
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-unicode.patch
@@ -0,0 +1,21 @@
+Index: python-dsv-1.4.1/DSV/DSV.py
+===================================================================
+--- python-dsv-1.4.1.orig/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500
++++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500
+@@ -486,8 +486,14 @@
+ list of lists of data
+ """
+ if type(input) != type([]):
+- raise InvalidData, "expected list of lists of strings"
+- if type(delimiter) != type('') or not delimiter:
++ raise InvalidData, "expected list of lists of strings"
++ # Try to convert Unicode delimiters back to ASCII (wxPython can be
++ # overenthusiastic), but ultimately support either.
++ try:
++ delimiter = delimiter.encode()
++ except:
++ pass
++ if (type(delimiter) != str and type(delimiter) != unicode) or not delimiter:
+ raise InvalidDelimiter, `delimiter`
+
+ ## if textQualifier:
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-wx-namespace.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-wx-namespace.patch
new file mode 100644
index 00000000..c4b819f
--- /dev/null
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-wx-namespace.patch
@@ -0,0 +1,435 @@
+Index: python-dsv-1.4.1/DSV/DSV.py
+===================================================================
+--- python-dsv-1.4.1.orig/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500
++++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:37:59.000000000 -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@bitpim.org> to accommodate
++ wxPython 2.8+
++
+ Basic use:
+
+ from DSV import DSV
+@@ -133,8 +136,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
+
+@@ -625,19 +634,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
+@@ -657,24 +666,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)
+@@ -686,13 +695,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',
+@@ -704,36 +713,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)
+@@ -741,52 +750,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),
+ ])
+
+ # -------------
+@@ -804,28 +813,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()
+@@ -855,9 +864,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())
+@@ -892,7 +901,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)
+
+@@ -902,13 +911,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
+@@ -928,17 +937,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
+@@ -955,22 +964,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)
+@@ -980,15 +989,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()
+@@ -1002,11 +1011,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,
+@@ -1034,12 +1043,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()
+
+@@ -1049,7 +1058,7 @@
+ file.write("LINE %d: %s\n" % (linenumber, oldrow))
+
+ 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()
+@@ -1074,7 +1083,7 @@
+ else:
+ dlg.Destroy()
+
+- return wx.true
++ return True
+
+ app = SampleApp()
+ app.MainLoop()
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-wxpython30.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-wxpython30.patch
new file mode 100644
index 00000000..c5ed573
--- /dev/null
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-wxpython30.patch
@@ -0,0 +1,21 @@
+--- a/DSV/DSV.py
++++ b/DSV/DSV.py
+@@ -676,7 +676,7 @@ if wx is not None:
+ style = wx.TAB_TRAVERSAL, name = "ImportWizardPanel"):
+ wx.Panel.__init__(self, parent, id, pos, size, style, name)
+ self.SetAutoLayout(True)
+- mainSizer = wx.FlexGridSizer(3, 1)
++ mainSizer = wx.FlexGridSizer(4, 1)
+ self.SetSizer(mainSizer)
+ mainSizer.AddGrowableCol(0)
+
+@@ -1089,7 +1089,8 @@ if __name__ == '__main__':
+ else:
+ dlg.Destroy()
+
+- return True
++ # return True
++ sys.exit()
+
+ app = SampleApp()
+ app.MainLoop()
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-wxversion.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-wxversion.patch
index e72dd78..cadc569 100644
--- a/dev-python/python-dsv/files/python-dsv-1.4.1-wxversion.patch
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-wxversion.patch
@@ -1,5 +1,5 @@
---- DSV/DSV.py
-+++ DSV/DSV.py
+--- a/DSV/DSV.py
++++ b/DSV/DSV.py
@@ -134,6 +134,13 @@
os.putenv('LANG', 'C')
diff --git a/dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild b/dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild
new file mode 100644
index 00000000..9543c62
--- /dev/null
+++ b/dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="Python module for importing and exporting DSV files"
+HOMEPAGE="http://python-dsv.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/DSV-${PV}.tar.gz"
+
+LICENSE="CNRI"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-python/wxpython:3.0[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/DSV-${PV}"
+
+PATCHES=(
+ # From Debian
+ "${FILESDIR}"/${P}-env.patch
+ "${FILESDIR}"/${P}-unicode.patch
+ "${FILESDIR}"/${P}-wx-namespace.patch
+ "${FILESDIR}"/${P}-wxpython30.patch
+)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/python-dsv/files/, dev-python/python-dsv/
@ 2017-10-15 12:36 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2017-10-15 12:36 UTC (permalink / raw
To: gentoo-commits
commit: d695735f23bab3a8b67e69a6721b2b1fc666f8f0
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 15 12:28:33 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Oct 15 12:35:59 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d695735f
dev-python/python-dsv: Move patches to a dist tarball
Closes: https://bugs.gentoo.org/620568
dev-python/python-dsv/Manifest | 1 +
.../python-dsv/files/python-dsv-1.4.1-env.patch | 21 -
.../files/python-dsv-1.4.1-unicode.patch | 21 -
.../files/python-dsv-1.4.1-wx-namespace.patch | 435 ---------------------
.../files/python-dsv-1.4.1-wxpython30.patch | 21 -
dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild | 13 +-
6 files changed, 8 insertions(+), 504 deletions(-)
diff --git a/dev-python/python-dsv/Manifest b/dev-python/python-dsv/Manifest
index d0a3141e684..33e3fa261cc 100644
--- a/dev-python/python-dsv/Manifest
+++ b/dev-python/python-dsv/Manifest
@@ -1 +1,2 @@
DIST DSV-1.4.1.tar.gz 14682 SHA256 5d0ec99c45f8ea91ea920dcd2cdf2cdc9e721985551ea80718519ce70dc98f15 SHA512 c26df1efabff9e70b6dfd17f6ff928f022ad19cfa39af431ef7ac663687e8d80406b0ad471376e238eeb6fcbab31aa2a84eaeae2949173e22316eb92e51f7ada WHIRLPOOL 565ef07a5c87cc4090b8b75df0fb992561865563ac3a0a8adaac2d1bc893e664d0db4d66836d9f682b2e69f62b2fc1fb1c3cdb649d973672b87a731887ded97d
+DIST python-dsv-1.4.1-gentoo-patchset.tar.bz2 5259 SHA256 f4e55836c60ec24285460755238e1eaaa9ddb7d03083934326c36003183b937e SHA512 c36335e5a6e423c53a9edec9dd795054e77b81a638d774a445bf1b621119c703064892eaff7ec67f85ce7e693af1156c39b3e60faaa5a800c1eca28ea7544f98 WHIRLPOOL 08d8eb7c2b9f9b0ce5b9daed3954757e6c9797055ceff76d1eab921c6a2f37e3ece1e490831219574cc67f6f7dbbdc0a164318112f16abefec299c8afa7d8bd4
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-env.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-env.patch
deleted file mode 100644
index c2e7aee946d..00000000000
--- a/dev-python/python-dsv/files/python-dsv-1.4.1-env.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Index: python-dsv-1.4.1/DSV/DSV.py
-===================================================================
---- python-dsv-1.4.1.orig/DSV/DSV.py 2003-08-09 06:37:32.000000000 -0400
-+++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:38:02.000000000 -0500
-@@ -127,11 +127,11 @@
- import copy
- import exceptions
- import string
--# RedHat 8.0 (or rather GTK2?) sets LANG = en_us.UTF-8 and apparently some
--# older apps (including wxGTK) can't handle this. The fix is to set LANG=C
--# before running the app. Thanks to Ahmad Baitalmal for supplying this info.
--import os
--os.putenv('LANG', 'C')
-+## RedHat 8.0 (or rather GTK2?) sets LANG = en_us.UTF-8 and apparently some
-+## older apps (including wxGTK) can't handle this. The fix is to set LANG=C
-+## before running the app. Thanks to Ahmad Baitalmal for supplying this info.
-+# import os
-+# os.putenv('LANG', 'C')
-
- try:
- from wxPython import wx, grid
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-unicode.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-unicode.patch
deleted file mode 100644
index 39faebe103b..00000000000
--- a/dev-python/python-dsv/files/python-dsv-1.4.1-unicode.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Index: python-dsv-1.4.1/DSV/DSV.py
-===================================================================
---- python-dsv-1.4.1.orig/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500
-+++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500
-@@ -486,8 +486,14 @@
- list of lists of data
- """
- if type(input) != type([]):
-- raise InvalidData, "expected list of lists of strings"
-- if type(delimiter) != type('') or not delimiter:
-+ raise InvalidData, "expected list of lists of strings"
-+ # Try to convert Unicode delimiters back to ASCII (wxPython can be
-+ # overenthusiastic), but ultimately support either.
-+ try:
-+ delimiter = delimiter.encode()
-+ except:
-+ pass
-+ if (type(delimiter) != str and type(delimiter) != unicode) or not delimiter:
- raise InvalidDelimiter, `delimiter`
-
- ## if textQualifier:
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-wx-namespace.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-wx-namespace.patch
deleted file mode 100644
index c4b819f6bb0..00000000000
--- a/dev-python/python-dsv/files/python-dsv-1.4.1-wx-namespace.patch
+++ /dev/null
@@ -1,435 +0,0 @@
-Index: python-dsv-1.4.1/DSV/DSV.py
-===================================================================
---- python-dsv-1.4.1.orig/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500
-+++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:37:59.000000000 -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@bitpim.org> to accommodate
-+ wxPython 2.8+
-+
- Basic use:
-
- from DSV import DSV
-@@ -133,8 +136,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
-
-@@ -625,19 +634,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
-@@ -657,24 +666,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)
-@@ -686,13 +695,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',
-@@ -704,36 +713,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)
-@@ -741,52 +750,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),
- ])
-
- # -------------
-@@ -804,28 +813,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()
-@@ -855,9 +864,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())
-@@ -892,7 +901,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)
-
-@@ -902,13 +911,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
-@@ -928,17 +937,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
-@@ -955,22 +964,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)
-@@ -980,15 +989,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()
-@@ -1002,11 +1011,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,
-@@ -1034,12 +1043,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()
-
-@@ -1049,7 +1058,7 @@
- file.write("LINE %d: %s\n" % (linenumber, oldrow))
-
- 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()
-@@ -1074,7 +1083,7 @@
- else:
- dlg.Destroy()
-
-- return wx.true
-+ return True
-
- app = SampleApp()
- app.MainLoop()
diff --git a/dev-python/python-dsv/files/python-dsv-1.4.1-wxpython30.patch b/dev-python/python-dsv/files/python-dsv-1.4.1-wxpython30.patch
deleted file mode 100644
index c5ed5738084..00000000000
--- a/dev-python/python-dsv/files/python-dsv-1.4.1-wxpython30.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/DSV/DSV.py
-+++ b/DSV/DSV.py
-@@ -676,7 +676,7 @@ if wx is not None:
- style = wx.TAB_TRAVERSAL, name = "ImportWizardPanel"):
- wx.Panel.__init__(self, parent, id, pos, size, style, name)
- self.SetAutoLayout(True)
-- mainSizer = wx.FlexGridSizer(3, 1)
-+ mainSizer = wx.FlexGridSizer(4, 1)
- self.SetSizer(mainSizer)
- mainSizer.AddGrowableCol(0)
-
-@@ -1089,7 +1089,8 @@ if __name__ == '__main__':
- else:
- dlg.Destroy()
-
-- return True
-+ # return True
-+ sys.exit()
-
- app = SampleApp()
- app.MainLoop()
diff --git a/dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild b/dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild
index 5a4498fa70a..b9159dd4d24 100644
--- a/dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild
+++ b/dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -8,7 +8,8 @@ inherit distutils-r1
DESCRIPTION="Python module for importing and exporting DSV files"
HOMEPAGE="http://python-dsv.sourceforge.net/"
-SRC_URI="mirror://sourceforge/${PN}/DSV-${PV}.tar.gz"
+SRC_URI="mirror://sourceforge/${PN}/DSV-${PV}.tar.gz
+ https://dev.gentoo.org/~mgorny/dist/${P}-gentoo-patchset.tar.bz2"
LICENSE="CNRI"
SLOT="0"
@@ -22,8 +23,8 @@ S="${WORKDIR}/DSV-${PV}"
PATCHES=(
# From Debian
- "${FILESDIR}"/${P}-env.patch
- "${FILESDIR}"/${P}-unicode.patch
- "${FILESDIR}"/${P}-wx-namespace.patch
- "${FILESDIR}"/${P}-wxpython30.patch
+ "${WORKDIR}/${P}-gentoo-patchset"/${P}-env.patch
+ "${WORKDIR}/${P}-gentoo-patchset"/${P}-unicode.patch
+ "${WORKDIR}/${P}-gentoo-patchset"/${P}-wx-namespace.patch
+ "${WORKDIR}/${P}-gentoo-patchset"/${P}-wxpython30.patch
)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-15 12:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-15 12:36 [gentoo-commits] repo/gentoo:master commit in: dev-python/python-dsv/files/, dev-python/python-dsv/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2016-11-29 20:45 Pacho Ramos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox