1 |
commit: e0080102e0e227828b70549f64f70d485622d723 |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 29 20:34:07 2016 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 29 20:45:31 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0080102 |
7 |
|
8 |
dev-python/python-dsv: Apply Debian patches also fixing wxpython3 compat (#601178) |
9 |
|
10 |
Package-Manager: portage-2.3.2 |
11 |
|
12 |
.../python-dsv/files/python-dsv-1.4.1-env.patch | 21 + |
13 |
.../files/python-dsv-1.4.1-unicode.patch | 21 + |
14 |
.../files/python-dsv-1.4.1-wx-namespace.patch | 435 +++++++++++++++++++++ |
15 |
.../files/python-dsv-1.4.1-wxpython30.patch | 21 + |
16 |
.../files/python-dsv-1.4.1-wxversion.patch | 4 +- |
17 |
dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild | 30 ++ |
18 |
6 files changed, 530 insertions(+), 2 deletions(-) |
19 |
|
20 |
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 |
21 |
new file mode 100644 |
22 |
index 00000000..c2e7aee |
23 |
--- /dev/null |
24 |
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-env.patch |
25 |
@@ -0,0 +1,21 @@ |
26 |
+Index: python-dsv-1.4.1/DSV/DSV.py |
27 |
+=================================================================== |
28 |
+--- python-dsv-1.4.1.orig/DSV/DSV.py 2003-08-09 06:37:32.000000000 -0400 |
29 |
++++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:38:02.000000000 -0500 |
30 |
+@@ -127,11 +127,11 @@ |
31 |
+ import copy |
32 |
+ import exceptions |
33 |
+ import string |
34 |
+-# RedHat 8.0 (or rather GTK2?) sets LANG = en_us.UTF-8 and apparently some |
35 |
+-# older apps (including wxGTK) can't handle this. The fix is to set LANG=C |
36 |
+-# before running the app. Thanks to Ahmad Baitalmal for supplying this info. |
37 |
+-import os |
38 |
+-os.putenv('LANG', 'C') |
39 |
++## RedHat 8.0 (or rather GTK2?) sets LANG = en_us.UTF-8 and apparently some |
40 |
++## older apps (including wxGTK) can't handle this. The fix is to set LANG=C |
41 |
++## before running the app. Thanks to Ahmad Baitalmal for supplying this info. |
42 |
++# import os |
43 |
++# os.putenv('LANG', 'C') |
44 |
+ |
45 |
+ try: |
46 |
+ from wxPython import wx, grid |
47 |
|
48 |
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 |
49 |
new file mode 100644 |
50 |
index 00000000..39faebe |
51 |
--- /dev/null |
52 |
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-unicode.patch |
53 |
@@ -0,0 +1,21 @@ |
54 |
+Index: python-dsv-1.4.1/DSV/DSV.py |
55 |
+=================================================================== |
56 |
+--- python-dsv-1.4.1.orig/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500 |
57 |
++++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500 |
58 |
+@@ -486,8 +486,14 @@ |
59 |
+ list of lists of data |
60 |
+ """ |
61 |
+ if type(input) != type([]): |
62 |
+- raise InvalidData, "expected list of lists of strings" |
63 |
+- if type(delimiter) != type('') or not delimiter: |
64 |
++ raise InvalidData, "expected list of lists of strings" |
65 |
++ # Try to convert Unicode delimiters back to ASCII (wxPython can be |
66 |
++ # overenthusiastic), but ultimately support either. |
67 |
++ try: |
68 |
++ delimiter = delimiter.encode() |
69 |
++ except: |
70 |
++ pass |
71 |
++ if (type(delimiter) != str and type(delimiter) != unicode) or not delimiter: |
72 |
+ raise InvalidDelimiter, `delimiter` |
73 |
+ |
74 |
+ ## if textQualifier: |
75 |
|
76 |
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 |
77 |
new file mode 100644 |
78 |
index 00000000..c4b819f |
79 |
--- /dev/null |
80 |
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-wx-namespace.patch |
81 |
@@ -0,0 +1,435 @@ |
82 |
+Index: python-dsv-1.4.1/DSV/DSV.py |
83 |
+=================================================================== |
84 |
+--- python-dsv-1.4.1.orig/DSV/DSV.py 2010-01-26 20:35:23.000000000 -0500 |
85 |
++++ python-dsv-1.4.1/DSV/DSV.py 2010-01-26 20:37:59.000000000 -0500 |
86 |
+@@ -2,6 +2,9 @@ |
87 |
+ DSV.py - Cliff Wells, 2002 |
88 |
+ Import/export DSV (delimiter separated values, a generalization of CSV). |
89 |
+ |
90 |
++2007-01-09: Modified by Joe Pham <djpham@××××××.org> to accommodate |
91 |
++ wxPython 2.8+ |
92 |
++ |
93 |
+ Basic use: |
94 |
+ |
95 |
+ from DSV import DSV |
96 |
+@@ -133,8 +136,14 @@ |
97 |
+ # import os |
98 |
+ # os.putenv('LANG', 'C') |
99 |
+ |
100 |
++##try: |
101 |
++## from wxPython import wx, grid |
102 |
++##except ImportError: |
103 |
++## wx = None |
104 |
++ |
105 |
+ try: |
106 |
+- from wxPython import wx, grid |
107 |
++ import wx |
108 |
++ import wx.grid as gridlib |
109 |
+ except ImportError: |
110 |
+ wx = None |
111 |
+ |
112 |
+@@ -625,19 +634,19 @@ |
113 |
+ |
114 |
+ if wx is not None: |
115 |
+ # ------------------------------------------------------------------------------ |
116 |
+- class ImportWizardPanel_Delimiters(wx.wxPanel): |
117 |
++ class ImportWizardPanel_Delimiters(wx.Panel): |
118 |
+ """ |
119 |
+ CLASS(SUPERCLASS): |
120 |
+- ImportWizardPanel_Delimiters(wx.wxPanel) |
121 |
++ ImportWizardPanel_Delimiters(wx.Panel) |
122 |
+ DESCRIPTION: |
123 |
+- A wx.wxPanel that provides a basic interface for validating and changing the |
124 |
++ A wx.Panel that provides a basic interface for validating and changing the |
125 |
+ parameters for importing a delimited text file. Similar to MS Excel's |
126 |
+ CSV import wizard. Can be used in a series of wizards or embedded in an |
127 |
+ application. |
128 |
+ PROTOTYPE: |
129 |
+ ImportWizardPanel_Delimiters(parent, id, file, data, isValidCallback = None, |
130 |
+- pos = wx.wxDefaultPosition, size = wx.wxDefaultSize, |
131 |
+- style = wx.wxTAB_TRAVERSAL, name = 'ImportWizardPanel') |
132 |
++ pos = wx.DefaultPosition, size = wx.DefaultSize, |
133 |
++ style = wx.TAB_TRAVERSAL, name = 'ImportWizardPanel') |
134 |
+ ARGUMENTS: |
135 |
+ - parent is the parent window |
136 |
+ - id is the id of this wizard panel |
137 |
+@@ -657,24 +666,24 @@ |
138 |
+ """ |
139 |
+ |
140 |
+ def __init__(self, parent, id, file, data, isValidCallback = None, |
141 |
+- pos = wx.wxDefaultPosition, size = wx.wxDefaultSize, |
142 |
+- style = wx.wxTAB_TRAVERSAL, name = "ImportWizardPanel"): |
143 |
+- wx.wxPanel.__init__(self, parent, id, pos, size, style, name) |
144 |
+- self.SetAutoLayout(wx.true) |
145 |
+- mainSizer = wx.wxFlexGridSizer(3, 1) |
146 |
++ pos = wx.DefaultPosition, size = wx.DefaultSize, |
147 |
++ style = wx.TAB_TRAVERSAL, name = "ImportWizardPanel"): |
148 |
++ wx.Panel.__init__(self, parent, id, pos, size, style, name) |
149 |
++ self.SetAutoLayout(True) |
150 |
++ mainSizer = wx.FlexGridSizer(3, 1) |
151 |
+ self.SetSizer(mainSizer) |
152 |
+ mainSizer.AddGrowableCol(0) |
153 |
+ |
154 |
+- self.initialized = wx.false |
155 |
++ self.initialized = False |
156 |
+ self.data = data |
157 |
+ self.isValidCallback = isValidCallback |
158 |
+ self.Validate = (isValidCallback and self.Validate) or self.BuildPreview |
159 |
+ |
160 |
+- dlg = wx.wxProgressDialog("Import Wizard", |
161 |
++ dlg = wx.ProgressDialog("Import Wizard", |
162 |
+ "Analyzing %s... Please wait." % file, |
163 |
+ 3, |
164 |
+ parent, |
165 |
+- wx.wxPD_APP_MODAL | wx.wxPD_AUTO_HIDE) |
166 |
++ wx.PD_APP_MODAL | wx.PD_AUTO_HIDE) |
167 |
+ textQualifier = guessTextQualifier(data) |
168 |
+ dlg.Update(1) |
169 |
+ newdata = organizeIntoLines(data, textQualifier = textQualifier, limit = 100) |
170 |
+@@ -686,13 +695,13 @@ |
171 |
+ # ------------- |
172 |
+ msg = ("This screen lets you set the delimiters your data contains.\n" |
173 |
+ "You can see how your data is affected in the preview below.") |
174 |
+- message1 = wx.wxStaticText(self, -1, msg) |
175 |
++ message1 = wx.StaticText(self, -1, msg) |
176 |
+ |
177 |
+ # ------------- |
178 |
+- delimiterBox = wx.wxBoxSizer(wx.wxHORIZONTAL) |
179 |
+- delimStaticBox = wx.wxStaticBox(self, -1, "Delimiters") |
180 |
+- delimStaticSizer = wx.wxStaticBoxSizer(delimStaticBox, wx.wxVERTICAL) |
181 |
+- delimGridSizer = wx.wxFlexGridSizer(2, 3) |
182 |
++ delimiterBox = wx.BoxSizer(wx.HORIZONTAL) |
183 |
++ delimStaticBox = wx.StaticBox(self, -1, "Delimiters") |
184 |
++ delimStaticSizer = wx.StaticBoxSizer(delimStaticBox, wx.VERTICAL) |
185 |
++ delimGridSizer = wx.FlexGridSizer(2, 3) |
186 |
+ |
187 |
+ delims = { |
188 |
+ 'Tab': '\t', |
189 |
+@@ -704,36 +713,36 @@ |
190 |
+ self.delimChecks = {} |
191 |
+ |
192 |
+ for label, value in delims.items(): |
193 |
+- self.delimChecks[value] = wx.wxCheckBox(self, -1, label) |
194 |
+- delimGridSizer.Add(self.delimChecks[value], 0, wx.wxALL, 3) |
195 |
++ self.delimChecks[value] = wx.CheckBox(self, -1, label) |
196 |
++ delimGridSizer.Add(self.delimChecks[value], 0, wx.ALL, 3) |
197 |
+ wx.EVT_CHECKBOX(self, self.delimChecks[value].GetId(), self.Validate) |
198 |
+ |
199 |
+- otherSizer = wx.wxBoxSizer(wx.wxHORIZONTAL) |
200 |
++ otherSizer = wx.BoxSizer(wx.HORIZONTAL) |
201 |
+ |
202 |
+- self.delimChecks['Other'] = wx.wxCheckBox(self, -1, 'Other:') |
203 |
++ self.delimChecks['Other'] = wx.CheckBox(self, -1, 'Other:') |
204 |
+ wx.EVT_CHECKBOX(self, self.delimChecks['Other'].GetId(), self.Validate) |
205 |
+ |
206 |
+- self.otherDelim = wx.wxTextCtrl(self, -1, size = (20, -1)) |
207 |
++ self.otherDelim = wx.TextCtrl(self, -1, size = (20, -1)) |
208 |
+ wx.EVT_TEXT(self, self.otherDelim.GetId(), self.OnCustomDelim) |
209 |
+ |
210 |
+ if self.delimChecks.has_key(delimiter): |
211 |
+- self.delimChecks[delimiter].SetValue(wx.true) |
212 |
++ self.delimChecks[delimiter].SetValue(True) |
213 |
+ elif delimiter is not None: |
214 |
+- self.delimChecks['Other'].SetValue(wx.true) |
215 |
++ self.delimChecks['Other'].SetValue(True) |
216 |
+ self.otherDelim.SetValue(delimiter) |
217 |
+ |
218 |
+ otherSizer.AddMany([ |
219 |
+- (self.delimChecks['Other'], 0, wx.wxALL, 3), |
220 |
+- (self.otherDelim, 0, wx.wxALIGN_CENTER), |
221 |
++ (self.delimChecks['Other'], 0, wx.ALL, 3), |
222 |
++ (self.otherDelim, 0, wx.ALIGN_CENTER), |
223 |
+ ]) |
224 |
+ |
225 |
+ delimGridSizer.Add(otherSizer) |
226 |
+- delimStaticSizer.Add(delimGridSizer, 1, wx.wxEXPAND) |
227 |
+- delimOtherSizer = wx.wxBoxSizer(wx.wxVERTICAL) |
228 |
+- self.consecutiveDelimsAs1 = wx.wxCheckBox(self, -1, "Treat consecutive delimiters as one") |
229 |
+- self.consecutiveDelimsAs1.Enable(wx.false) |
230 |
+- tqSizer = wx.wxBoxSizer(wx.wxHORIZONTAL) |
231 |
+- self.textQualifierChoice = wx.wxChoice(self, -1, choices = ['"', "'", "{None}"]) |
232 |
++ delimStaticSizer.Add(delimGridSizer, 1, wx.EXPAND) |
233 |
++ delimOtherSizer = wx.BoxSizer(wx.VERTICAL) |
234 |
++ self.consecutiveDelimsAs1 = wx.CheckBox(self, -1, "Treat consecutive delimiters as one") |
235 |
++ self.consecutiveDelimsAs1.Enable(False) |
236 |
++ tqSizer = wx.BoxSizer(wx.HORIZONTAL) |
237 |
++ self.textQualifierChoice = wx.Choice(self, -1, choices = ['"', "'", "{None}"]) |
238 |
+ wx.EVT_CHOICE(self, self.textQualifierChoice.GetId(), self.BuildPreview) |
239 |
+ if textQualifier is not None: |
240 |
+ self.textQualifierChoice.SetStringSelection(textQualifier) |
241 |
+@@ -741,52 +750,52 @@ |
242 |
+ self.textQualifierChoice.SetStringSelection('{None}') |
243 |
+ |
244 |
+ tqSizer.AddMany([ |
245 |
+- (wx.wxStaticText(self, -1, "Text qualifier:"), 0, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL), |
246 |
+- (self.textQualifierChoice, 0, wx.wxALL | wx.wxALIGN_LEFT | wx.wxALIGN_CENTER_VERTICAL, 5), |
247 |
++ (wx.StaticText(self, -1, "Text qualifier:"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL), |
248 |
++ (self.textQualifierChoice, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5), |
249 |
+ ]) |
250 |
+ |
251 |
+ delimOtherSizer.AddMany([ |
252 |
+- (self.consecutiveDelimsAs1, 1, wx.wxEXPAND | wx.wxALL, 5), |
253 |
+- (tqSizer, 1, wx.wxALL | wx.wxALIGN_CENTER, 5), |
254 |
++ (self.consecutiveDelimsAs1, 1, wx.EXPAND | wx.ALL, 5), |
255 |
++ (tqSizer, 1, wx.ALL | wx.ALIGN_CENTER, 5), |
256 |
+ ]) |
257 |
+ |
258 |
+ delimiterBox.AddMany([ |
259 |
+- (delimStaticSizer, 0, wx.wxALIGN_CENTER), |
260 |
+- (delimOtherSizer, 0, wx.wxALIGN_CENTER), |
261 |
++ (delimStaticSizer, 0, wx.ALIGN_CENTER), |
262 |
++ (delimOtherSizer, 0, wx.ALIGN_CENTER), |
263 |
+ ]) |
264 |
+ |
265 |
+ delimStaticBox.Fit() |
266 |
+ |
267 |
+ # ------------- |
268 |
+ self.displayRows = 6 |
269 |
+- previewSettingsBox = wx.wxBoxSizer(wx.wxHORIZONTAL) |
270 |
+- self.hasHeaderRow = wx.wxCheckBox(self, -1, "First row is header") |
271 |
++ previewSettingsBox = wx.BoxSizer(wx.HORIZONTAL) |
272 |
++ self.hasHeaderRow = wx.CheckBox(self, -1, "First row is header") |
273 |
+ wx.EVT_CHECKBOX(self, self.hasHeaderRow.GetId(), self.BuildPreview) |
274 |
+ |
275 |
+- if wx.wxPlatform in ('__WX.WXGTK__', '__WX.WXMSW__'): |
276 |
+- # wx.wxSpinCtrl causes seg fault under GTK when <enter> is hit in text - use wx.wxSpinButton instead |
277 |
+- self.previewRowsText = wx.wxTextCtrl(self, -1, str(self.displayRows), |
278 |
+- size = (30, -1), style = wx.wxTE_PROCESS_ENTER) |
279 |
++ if wx.Platform in ('__WX.WXGTK__', '__WX.WXMSW__'): |
280 |
++ # wx.SpinCtrl causes seg fault under GTK when <enter> is hit in text - use wx.SpinButton instead |
281 |
++ self.previewRowsText = wx.TextCtrl(self, -1, str(self.displayRows), |
282 |
++ size = (30, -1), style = wx.TE_PROCESS_ENTER) |
283 |
+ h = self.previewRowsText.GetSize().height |
284 |
+- self.previewRows = wx.wxSpinButton(self, -1, size = (-1, h), style = wx.wxSP_VERTICAL) |
285 |
++ self.previewRows = wx.SpinButton(self, -1, size = (-1, h), style = wx.SP_VERTICAL) |
286 |
+ self.previewRows.SetRange(self.displayRows, 100) |
287 |
+ self.previewRows.SetValue(self.displayRows) |
288 |
+ wx.EVT_SPIN(self, self.previewRows.GetId(), self.OnSpinPreviewRows) |
289 |
+ wx.EVT_TEXT_ENTER(self, self.previewRowsText.GetId(), self.OnTextPreviewRows) |
290 |
+ else: |
291 |
+- self.previewRows = wx.wxSpinCtrl(self, -1, str(self.displayRows), |
292 |
++ self.previewRows = wx.SpinCtrl(self, -1, str(self.displayRows), |
293 |
+ min = self.displayRows, max = 100, size = (50, -1)) |
294 |
+ wx.EVT_SPINCTRL(self, self.previewRows.GetId(), self.BuildPreview) |
295 |
+ |
296 |
+ previewSettingsBox.AddMany([ |
297 |
+- (self.hasHeaderRow, 1, wx.wxALL | wx.wxEXPAND, 5), |
298 |
+- (wx.wxStaticText(self, -1, "Preview"), 0, wx.wxWEST | wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL, 10), |
299 |
++ (self.hasHeaderRow, 1, wx.ALL | wx.EXPAND, 5), |
300 |
++ (wx.StaticText(self, -1, "Preview"), 0, wx.WEST | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 10), |
301 |
+ ]) |
302 |
+- if wx.wxPlatform in ('__WX.WXGTK__', '__WX.WXMSW__'): |
303 |
+- previewSettingsBox.Add(self.previewRowsText, 0, wx.wxALIGN_CENTER | wx.wxALL, 3) |
304 |
++ if wx.Platform in ('__WX.WXGTK__', '__WX.WXMSW__'): |
305 |
++ previewSettingsBox.Add(self.previewRowsText, 0, wx.ALIGN_CENTER | wx.ALL, 3) |
306 |
+ previewSettingsBox.AddMany([ |
307 |
+- (self.previewRows, 0, wx.wxALIGN_CENTER | wx.wxALL, 3), |
308 |
+- (wx.wxStaticText(self, -1, "rows"), 0, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL), |
309 |
++ (self.previewRows, 0, wx.ALIGN_CENTER | wx.ALL, 3), |
310 |
++ (wx.StaticText(self, -1, "rows"), 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL), |
311 |
+ ]) |
312 |
+ |
313 |
+ # ------------- |
314 |
+@@ -804,28 +813,28 @@ |
315 |
+ hasHeaders = 0 |
316 |
+ cols = 1 |
317 |
+ |
318 |
+- previewStaticBox = wx.wxStaticBox(self, -1, "Data Preview") |
319 |
+- previewStaticSizer = wx.wxStaticBoxSizer(previewStaticBox, wx.wxVERTICAL) |
320 |
+- self.preview = grid.wxGrid(self, -1) |
321 |
++ previewStaticBox = wx.StaticBox(self, -1, "Data Preview") |
322 |
++ previewStaticSizer = wx.StaticBoxSizer(previewStaticBox, wx.VERTICAL) |
323 |
++ self.preview = gridlib.Grid(self, -1) |
324 |
+ self.preview.CreateGrid(self.displayRows, cols) |
325 |
+- self.preview.SetDefaultRowSize(self.preview.GetCharHeight() + 4, wx.true) |
326 |
+- self.preview.EnableEditing(wx.false) |
327 |
++ self.preview.SetDefaultRowSize(self.preview.GetCharHeight() + 4, True) |
328 |
++ self.preview.EnableEditing(False) |
329 |
+ self.preview.SetColLabelSize(0) |
330 |
+ self.preview.SetRowLabelSize(0) |
331 |
+ self.preview.SetMargins(1, 0) |
332 |
+- self.initialized = wx.true |
333 |
++ self.initialized = True |
334 |
+ self.BuildPreview() |
335 |
+ |
336 |
+ rowheight = self.preview.GetRowSize(0) + 2 |
337 |
+ self.preview.SetSize((-1, rowheight * self.displayRows)) |
338 |
+- previewStaticSizer.Add(self.preview, 0, wx.wxALL | wx.wxEXPAND, 5) |
339 |
++ previewStaticSizer.Add(self.preview, 0, wx.ALL | wx.EXPAND, 5) |
340 |
+ |
341 |
+ # ------------- |
342 |
+ mainSizer.AddMany([ |
343 |
+- (message1, 0, wx.wxALL, 5), |
344 |
+- (delimiterBox, 0, wx.wxALL, 5), |
345 |
+- (previewSettingsBox, 0, wx.wxALL, 5), |
346 |
+- (previewStaticSizer, 0, wx.wxALL | wx.wxEXPAND, 5), |
347 |
++ (message1, 0, wx.ALL, 5), |
348 |
++ (delimiterBox, 0, wx.ALL, 5), |
349 |
++ (previewSettingsBox, 0, wx.ALL, 5), |
350 |
++ (previewStaticSizer, 0, wx.ALL | wx.EXPAND, 5), |
351 |
+ ]) |
352 |
+ |
353 |
+ self.Layout() |
354 |
+@@ -855,9 +864,9 @@ |
355 |
+ if not self.initialized: |
356 |
+ return # got triggered before initialization was completed |
357 |
+ |
358 |
+- if wx.wxPlatform != '__WX.WXGTK__': |
359 |
+- wx.wxBeginBusyCursor() # causes a spurious spin event under GTK |
360 |
+- wx.wxYield() # allow controls to update first, in case of slow preview |
361 |
++ if wx.Platform != '__WX.WXGTK__': |
362 |
++ wx.BeginBusyCursor() # causes a spurious spin event under GTK |
363 |
++ wx.Yield() # allow controls to update first, in case of slow preview |
364 |
+ self.preview.BeginBatch() |
365 |
+ self.preview.DeleteCols(0, self.preview.GetNumberCols()) |
366 |
+ self.preview.DeleteRows(0, self.preview.GetNumberRows()) |
367 |
+@@ -892,7 +901,7 @@ |
368 |
+ for col in range(cols): |
369 |
+ try: self.preview.SetColLabelValue(col, str(previewData[0][col])) |
370 |
+ except: self.preview.SetColLabelValue(col, "") |
371 |
+- # self.preview.AutoSizeColumns(wx.true) # size columns to headers |
372 |
++ # self.preview.AutoSizeColumns(True) # size columns to headers |
373 |
+ else: |
374 |
+ self.preview.SetColLabelSize(0) |
375 |
+ |
376 |
+@@ -902,13 +911,13 @@ |
377 |
+ except: pass |
378 |
+ |
379 |
+ # if not hasHeaders: |
380 |
+- self.preview.AutoSizeColumns(wx.true) # size columns to data |
381 |
++ self.preview.AutoSizeColumns(True) # size columns to data |
382 |
+ |
383 |
+ rowheight = self.preview.GetRowSize(0) |
384 |
+ self.preview.SetRowSize(0, rowheight) |
385 |
+ self.preview.EndBatch() |
386 |
+- if wx.wxPlatform != '__WX.WXGTK__': |
387 |
+- wx.wxEndBusyCursor() |
388 |
++ if wx.Platform != '__WX.WXGTK__': |
389 |
++ wx.EndBusyCursor() |
390 |
+ |
391 |
+ self.delimiters = delimiter |
392 |
+ self.textQualifier = textQualifier |
393 |
+@@ -928,17 +937,17 @@ |
394 |
+ return self.hasHeaders |
395 |
+ |
396 |
+ # ------------------------------------------------------------------------------ |
397 |
+- class ImportWizardDialog(wx.wxDialog): |
398 |
++ class ImportWizardDialog(wx.Dialog): |
399 |
+ """ |
400 |
+ CLASS(SUPERCLASS): |
401 |
+- ImportWizardDialog(wx.wxDialog) |
402 |
++ ImportWizardDialog(wx.Dialog) |
403 |
+ DESCRIPTION: |
404 |
+ A dialog allowing the user to preview and change the options for importing |
405 |
+ a file. |
406 |
+ PROTOTYPE: |
407 |
+ ImportWizardDialog(parent, id, title, file, |
408 |
+- pos = wx.wxDefaultPosition, size = wx.wxDefaultSize, |
409 |
+- style = wx.wxDEFAULT_DIALOG_STYLE, name = 'ImportWizardDialog') |
410 |
++ pos = wx.DefaultPosition, size = wx.DefaultSize, |
411 |
++ style = wx.DEFAULT_DIALOG_STYLE, name = 'ImportWizardDialog') |
412 |
+ ARGUMENTS: |
413 |
+ - parent: the parent window |
414 |
+ - id: the id of this window |
415 |
+@@ -955,22 +964,22 @@ |
416 |
+ """ |
417 |
+ |
418 |
+ def __init__(self, parent, id, title, file, |
419 |
+- pos = wx.wxDefaultPosition, size = wx.wxDefaultSize, |
420 |
+- style = wx.wxDEFAULT_DIALOG_STYLE, name = "ImportWizardDialog"): |
421 |
+- wx.wxDialog.__init__(self, parent, id, title, pos, size, style, name) |
422 |
+- self.SetAutoLayout(wx.true) |
423 |
++ pos = wx.DefaultPosition, size = wx.DefaultSize, |
424 |
++ style = wx.DEFAULT_DIALOG_STYLE, name = "ImportWizardDialog"): |
425 |
++ wx.Dialog.__init__(self, parent, id, title, pos, size, style, name) |
426 |
++ self.SetAutoLayout(True) |
427 |
+ |
428 |
+ self.file = file |
429 |
+ f = open(file, 'r') |
430 |
+ self.data = f.read() |
431 |
+ f.close() |
432 |
+ |
433 |
+- sizer = wx.wxBoxSizer(wx.wxVERTICAL) |
434 |
++ sizer = wx.BoxSizer(wx.VERTICAL) |
435 |
+ self.delimPanel = ImportWizardPanel_Delimiters(self, -1, file, self.data, self.ValidState) |
436 |
+ buttonBox = self.ButtonBox() |
437 |
+ sizer.AddMany([ |
438 |
+- (self.delimPanel, 0, wx.wxALL, 5), |
439 |
+- (buttonBox, 0, wx.wxSOUTH | wx.wxALIGN_CENTER_HORIZONTAL | wx.wxALIGN_TOP, 0), |
440 |
++ (self.delimPanel, 0, wx.ALL, 5), |
441 |
++ (buttonBox, 0, wx.SOUTH | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_TOP, 0), |
442 |
+ ]) |
443 |
+ |
444 |
+ self.SetSizer(sizer) |
445 |
+@@ -980,15 +989,15 @@ |
446 |
+ self.Centre() |
447 |
+ |
448 |
+ def ButtonBox(self): |
449 |
+- panel = wx.wxPanel(self, -1) |
450 |
+- panel.SetAutoLayout(wx.true) |
451 |
+- sizer = wx.wxBoxSizer(wx.wxHORIZONTAL) |
452 |
++ panel = wx.Panel(self, -1) |
453 |
++ panel.SetAutoLayout(True) |
454 |
++ sizer = wx.BoxSizer(wx.HORIZONTAL) |
455 |
+ panel.SetSizer(sizer) |
456 |
+- self.ok = wx.wxButton(panel, wx.wxID_OK, "Ok") |
457 |
+- cancel = wx.wxButton(panel, wx.wxID_CANCEL, "Cancel") |
458 |
++ self.ok = wx.Button(panel, wx.ID_OK, "Ok") |
459 |
++ cancel = wx.Button(panel, wx.ID_CANCEL, "Cancel") |
460 |
+ sizer.AddMany([ |
461 |
+- (self.ok, 0, wx.wxALIGN_TOP | wx.wxEAST | wx.wxSOUTH, 10), |
462 |
+- (cancel, 0, wx.wxALIGN_TOP | wx.wxWEST | wx.wxSOUTH, 10), |
463 |
++ (self.ok, 0, wx.ALIGN_TOP | wx.EAST | wx.SOUTH, 10), |
464 |
++ (cancel, 0, wx.ALIGN_TOP | wx.WEST | wx.SOUTH, 10), |
465 |
+ ]) |
466 |
+ panel.Layout() |
467 |
+ panel.Fit() |
468 |
+@@ -1002,11 +1011,11 @@ |
469 |
+ def ImportData(self, errorHandler = skipRow): |
470 |
+ delimiters, qualifier, hasHeaders = self.GetImportInfo() |
471 |
+ self.data = organizeIntoLines(self.data, textQualifier = qualifier) |
472 |
+- dlg = wx.wxProgressDialog("Import DSV File", |
473 |
++ dlg = wx.ProgressDialog("Import DSV File", |
474 |
+ self.file, |
475 |
+ 100, |
476 |
+ self, |
477 |
+- wx.wxPD_CAN_ABORT | wx.wxPD_APP_MODAL | wx.wxPD_AUTO_HIDE) |
478 |
++ wx.PD_CAN_ABORT | wx.PD_APP_MODAL | wx.PD_AUTO_HIDE) |
479 |
+ self.data = importDSV(self.data, |
480 |
+ delimiter = delimiters, |
481 |
+ textQualifier = qualifier, |
482 |
+@@ -1034,12 +1043,12 @@ |
483 |
+ |
484 |
+ |
485 |
+ def demo(): |
486 |
+- class SampleApp(wx.wxApp): |
487 |
++ class SampleApp(wx.App): |
488 |
+ def OnInit(self): |
489 |
+- dlg = wx.wxFileDialog(None, "Choose a file", ".", "", |
490 |
++ dlg = wx.FileDialog(None, "Choose a file", ".", "", |
491 |
+ "CSV files (*.csv)|*.csv|Text files (*.txt)|*.txt|All files (*.*)|*.*", |
492 |
+- wx.wxOPEN) |
493 |
+- if dlg.ShowModal() == wx.wxID_OK: |
494 |
++ wx.OPEN) |
495 |
++ if dlg.ShowModal() == wx.ID_OK: |
496 |
+ path = dlg.GetPath() |
497 |
+ dlg.Destroy() |
498 |
+ |
499 |
+@@ -1049,7 +1058,7 @@ |
500 |
+ file.write("LINE %d: %s\n" % (linenumber, oldrow)) |
501 |
+ |
502 |
+ dlg = ImportWizardDialog(None, -1, 'CSV Import Wizard (v.%s)' % __version__, path) |
503 |
+- if dlg.ShowModal() == wx.wxID_OK: |
504 |
++ if dlg.ShowModal() == wx.ID_OK: |
505 |
+ results = dlg.ImportData(errorHandler = logErrors) |
506 |
+ dlg.Destroy() |
507 |
+ errorLog.close() |
508 |
+@@ -1074,7 +1083,7 @@ |
509 |
+ else: |
510 |
+ dlg.Destroy() |
511 |
+ |
512 |
+- return wx.true |
513 |
++ return True |
514 |
+ |
515 |
+ app = SampleApp() |
516 |
+ app.MainLoop() |
517 |
|
518 |
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 |
519 |
new file mode 100644 |
520 |
index 00000000..c5ed573 |
521 |
--- /dev/null |
522 |
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-wxpython30.patch |
523 |
@@ -0,0 +1,21 @@ |
524 |
+--- a/DSV/DSV.py |
525 |
++++ b/DSV/DSV.py |
526 |
+@@ -676,7 +676,7 @@ if wx is not None: |
527 |
+ style = wx.TAB_TRAVERSAL, name = "ImportWizardPanel"): |
528 |
+ wx.Panel.__init__(self, parent, id, pos, size, style, name) |
529 |
+ self.SetAutoLayout(True) |
530 |
+- mainSizer = wx.FlexGridSizer(3, 1) |
531 |
++ mainSizer = wx.FlexGridSizer(4, 1) |
532 |
+ self.SetSizer(mainSizer) |
533 |
+ mainSizer.AddGrowableCol(0) |
534 |
+ |
535 |
+@@ -1089,7 +1089,8 @@ if __name__ == '__main__': |
536 |
+ else: |
537 |
+ dlg.Destroy() |
538 |
+ |
539 |
+- return True |
540 |
++ # return True |
541 |
++ sys.exit() |
542 |
+ |
543 |
+ app = SampleApp() |
544 |
+ app.MainLoop() |
545 |
|
546 |
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 |
547 |
index e72dd78..cadc569 100644 |
548 |
--- a/dev-python/python-dsv/files/python-dsv-1.4.1-wxversion.patch |
549 |
+++ b/dev-python/python-dsv/files/python-dsv-1.4.1-wxversion.patch |
550 |
@@ -1,5 +1,5 @@ |
551 |
---- DSV/DSV.py |
552 |
-+++ DSV/DSV.py |
553 |
+--- a/DSV/DSV.py |
554 |
++++ b/DSV/DSV.py |
555 |
@@ -134,6 +134,13 @@ |
556 |
os.putenv('LANG', 'C') |
557 |
|
558 |
|
559 |
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 |
560 |
new file mode 100644 |
561 |
index 00000000..9543c62 |
562 |
--- /dev/null |
563 |
+++ b/dev-python/python-dsv/python-dsv-1.4.1-r2.ebuild |
564 |
@@ -0,0 +1,30 @@ |
565 |
+# Copyright 1999-2016 Gentoo Foundation |
566 |
+# Distributed under the terms of the GNU General Public License v2 |
567 |
+# $Id$ |
568 |
+ |
569 |
+EAPI=6 |
570 |
+PYTHON_COMPAT=( python2_7 ) |
571 |
+ |
572 |
+inherit distutils-r1 |
573 |
+ |
574 |
+DESCRIPTION="Python module for importing and exporting DSV files" |
575 |
+HOMEPAGE="http://python-dsv.sourceforge.net/" |
576 |
+SRC_URI="mirror://sourceforge/${PN}/DSV-${PV}.tar.gz" |
577 |
+ |
578 |
+LICENSE="CNRI" |
579 |
+SLOT="0" |
580 |
+KEYWORDS="~amd64 ~x86" |
581 |
+IUSE="" |
582 |
+ |
583 |
+RDEPEND="dev-python/wxpython:3.0[${PYTHON_USEDEP}]" |
584 |
+DEPEND="${RDEPEND}" |
585 |
+ |
586 |
+S="${WORKDIR}/DSV-${PV}" |
587 |
+ |
588 |
+PATCHES=( |
589 |
+ # From Debian |
590 |
+ "${FILESDIR}"/${P}-env.patch |
591 |
+ "${FILESDIR}"/${P}-unicode.patch |
592 |
+ "${FILESDIR}"/${P}-wx-namespace.patch |
593 |
+ "${FILESDIR}"/${P}-wxpython30.patch |
594 |
+) |