Il giorno dom, 21/12/2014 alle 20.07 +0000, Olly Betts ha scritto:
> On Sun, Dec 21, 2014 at 12:41:19AM +0100, Pietro Battiston wrote:
> > Il giorno sab, 20/12/2014 alle 10.37 +0000, Olly Betts ha scritto:
> > > On Sat, Dec 20, 2014 at 10:10:53AM +0100, Pietro Battiston wrote:
> > 
> > [...]
> > 1) I and other people (a niche, but a stable niche, and if I don't
> > misinterpret popcon, its 0.03% of active users locate it in the top 10%
> > of debian packages) use it
> 
> I think you must be misinterpreting - popcon doesn't report data about
> how much people use the packages they have installed (only if they've
> used each package "recently").
> 

Sorry... I'm missing the difference!

> [...]
> I tried to test the latest fontypython version (your NMU) but the
> package seems to be missing any actual python code:
> [...]

Yes, that's exactly what I meant when I said my package was useless.

> 
> It looks like the assertions are due to trying to create wx.Locale
> objects before the wx.App object.  It doesn't need to create one in
> every file - just creating one should be enough.
> 

No worry, the lines you deleted are apparently not needed at all.

> It then runs into the wx.ListCtrl issue you mention in the other bug.
> The simple fix is to just disable all such assertions (as happens by
> default with wx 2.8):
> 
> http://anonscm.debian.org/cgit/collab-maint/wx-migration-tools.git/tree/README
> 
> With that, fontypython runs for me - I'll send an nmudiff in a moment.
> 
> It would be better to try to fix them, but I don't have time to dig
> in deeper.  If you want to, please do - or let me know if you'd like
> me to just upload my NMU.
> 

I did fix the issue (patch 0003-... in the attached debdiff), but your
approach may be better suited for jessie. Most importantly, I introduced
another minimal patch to fix an annoying bug (patch 0001-...).

Feel free to upload my nmu or to only pick this last patch, as you think
is more appropriate.

Pietro
diff -Nru fontypython-0.4.4/debian/changelog fontypython-0.4.4/debian/changelog
--- fontypython-0.4.4/debian/changelog	2014-12-21 23:05:39.000000000 +0100
+++ fontypython-0.4.4/debian/changelog	2014-12-21 22:57:15.000000000 +0100
@@ -1,3 +1,12 @@
+fontypython (0.4.4-1.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Removed flawed patch (wx 2.8 is not in jessie)
+  * Patch: do not crash on empty pogs list
+  * Patches for compatibility with wxpython 3.0 (Closes: #773579)
+
+ -- Pietro Battiston <m...@pietrobattiston.it>  Sun, 21 Dec 2014 22:54:02 +0100
+
 fontypython (0.4.4-1.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru fontypython-0.4.4/debian/patches/0001-Do-not-crash-on-empty-pogs-list.patch fontypython-0.4.4/debian/patches/0001-Do-not-crash-on-empty-pogs-list.patch
--- fontypython-0.4.4/debian/patches/0001-Do-not-crash-on-empty-pogs-list.patch	1970-01-01 01:00:00.000000000 +0100
+++ fontypython-0.4.4/debian/patches/0001-Do-not-crash-on-empty-pogs-list.patch	2014-12-21 22:49:18.000000000 +0100
@@ -0,0 +1,21 @@
+From: Pietro Battiston <m...@pietrobattiston.it>
+Date: Sun, 21 Dec 2014 11:50:28 +0100
+Subject: Do not crash on empty pogs list
+
+---
+ fontypythonmodules/gui_PogChooser.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fontypythonmodules/gui_PogChooser.py b/fontypythonmodules/gui_PogChooser.py
+index 94b7f2e..f233529 100644
+--- a/fontypythonmodules/gui_PogChooser.py
++++ b/fontypythonmodules/gui_PogChooser.py
+@@ -80,7 +80,7 @@ class PogChooser(wx.ListCtrl) :
+ 			i = self.FindItem(-1, select)
+ 			self.indexselected = i # Set this to help initial icon settings.
+ 			self.Select(i, True)
+-		else:
++		elif self.__poglistCopy:
+ 			self.Select(0, False)
+ 			self.indexselected = -1
+ 
diff -Nru fontypython-0.4.4/debian/patches/0001-Select-wx-2.8-rather-than-3.0.patch fontypython-0.4.4/debian/patches/0001-Select-wx-2.8-rather-than-3.0.patch
--- fontypython-0.4.4/debian/patches/0001-Select-wx-2.8-rather-than-3.0.patch	2014-12-21 23:05:39.000000000 +0100
+++ fontypython-0.4.4/debian/patches/0001-Select-wx-2.8-rather-than-3.0.patch	1970-01-01 01:00:00.000000000 +0100
@@ -1,21 +0,0 @@
-From: Pietro Battiston <m...@pietrobattiston.it>
-Date: Sun, 14 Dec 2014 09:39:17 +0100
-Subject: Select wx 2.8 (rather than 3.0)
-
----
- fontypythonmodules/sanitycheck.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/fontypythonmodules/sanitycheck.py b/fontypythonmodules/sanitycheck.py
-index cf4fcc1..0448b6b 100644
---- a/fontypythonmodules/sanitycheck.py
-+++ b/fontypythonmodules/sanitycheck.py
-@@ -31,7 +31,7 @@ except:
- 
- try:
- 	import wxversion ## Dec 2007: noticed that it may not be installed along with wxPython....
--	wxversion.ensureMinimal("2.8") 
-+	wxversion.select("2.8")
- except:
- 	print strings.wxVersionError
- 	print
diff -Nru fontypython-0.4.4/debian/patches/0002-Removed-unused-code-which-causes-crash-with-wx-3.0.patch fontypython-0.4.4/debian/patches/0002-Removed-unused-code-which-causes-crash-with-wx-3.0.patch
--- fontypython-0.4.4/debian/patches/0002-Removed-unused-code-which-causes-crash-with-wx-3.0.patch	1970-01-01 01:00:00.000000000 +0100
+++ fontypython-0.4.4/debian/patches/0002-Removed-unused-code-which-causes-crash-with-wx-3.0.patch	2014-12-21 22:49:18.000000000 +0100
@@ -0,0 +1,134 @@
+From: Pietro Battiston <m...@pietrobattiston.it>
+Date: Sun, 21 Dec 2014 09:14:19 +0100
+Subject: Removed unused code which causes crash with wx 3.0
+
+---
+ fontypython                                | 2 --
+ fontypythonmodules/dialogues.py            | 4 ----
+ fontypythonmodules/gui_Left.py             | 4 ----
+ fontypythonmodules/gui_Middle.py           | 5 -----
+ fontypythonmodules/gui_PogChooser.py       | 4 ----
+ fontypythonmodules/gui_Right.py            | 4 ----
+ fontypythonmodules/gui_ScrolledFontView.py | 4 ----
+ fontypythonmodules/wxgui.py                | 4 ----
+ 8 files changed, 31 deletions(-)
+
+diff --git a/fontypython b/fontypython
+index a05290f..e46e34e 100755
+--- a/fontypython
++++ b/fontypython
+@@ -72,8 +72,6 @@ else: # err code -11
+ 
+ 	## Setup wxPython to access translations : enables the stock buttons.
+ 	localedir = "fontypythonmodules/locales"
+-	langid = wx.LANGUAGE_DEFAULT
+-	mylocale = wx.Locale( langid )
+ 
+ 	iPC = PC.PathControl() 
+ 
+diff --git a/fontypythonmodules/dialogues.py b/fontypythonmodules/dialogues.py
+index 1fbff5f..eba7ab3 100644
+--- a/fontypythonmodules/dialogues.py
++++ b/fontypythonmodules/dialogues.py
+@@ -23,10 +23,6 @@ import wx
+ import wx.html as html
+ 
+ 
+-## Setup wxPython to access translations : enables the stock buttons.
+-langid = wx.LANGUAGE_DEFAULT # Picks this up from $LANG
+-mylocale = wx.Locale( langid )
+-
+ ## langcode = locale.getlocale()[0] # I must not use getlocale...
+ ## This is suggested by Martin:
+ loc = locale.setlocale(locale.LC_CTYPE) # use *one* of the categories (not LC_ALL)
+diff --git a/fontypythonmodules/gui_Left.py b/fontypythonmodules/gui_Left.py
+index 5451f39..7b1f0c6 100644
+--- a/fontypythonmodules/gui_Left.py
++++ b/fontypythonmodules/gui_Left.py
+@@ -17,10 +17,6 @@
+ 
+ import wx, os
+ 
+-## Setup wxPython to access translations : enables the stock buttons.
+-langid = wx.LANGUAGE_DEFAULT # Picks this up from $LANG
+-mylocale = wx.Locale( langid )
+-
+ 
+ from pubsub import *
+ from wxgui import ps
+diff --git a/fontypythonmodules/gui_Middle.py b/fontypythonmodules/gui_Middle.py
+index 470e3ea..9af3f9f 100644
+--- a/fontypythonmodules/gui_Middle.py
++++ b/fontypythonmodules/gui_Middle.py
+@@ -19,11 +19,6 @@ import wx
+ import wx.lib.stattext
+ import  wx.lib.buttons  as  buttons
+ 
+-## Setup wxPython to access translations : enables the stock buttons.
+-langid = wx.LANGUAGE_DEFAULT # Picks this up from $LANG
+-mylocale = wx.Locale( langid )
+-
+-
+ from pubsub import *
+ from wxgui import ps
+ 
+diff --git a/fontypythonmodules/gui_PogChooser.py b/fontypythonmodules/gui_PogChooser.py
+index f233529..c679191 100644
+--- a/fontypythonmodules/gui_PogChooser.py
++++ b/fontypythonmodules/gui_PogChooser.py
+@@ -17,10 +17,6 @@
+ 
+ import wx, locale
+ 
+-## Setup wxPython to access translations : enables the stock buttons.
+-langid = wx.LANGUAGE_DEFAULT # Picks this up from $LANG
+-mylocale = wx.Locale( langid )
+-
+ from pubsub import *
+ from wxgui import ps
+ 
+diff --git a/fontypythonmodules/gui_Right.py b/fontypythonmodules/gui_Right.py
+index adefa1d..ea5062b 100644
+--- a/fontypythonmodules/gui_Right.py
++++ b/fontypythonmodules/gui_Right.py
+@@ -17,10 +17,6 @@
+ 
+ import wx
+ 
+-## Setup wxPython to access translations : enables the stock buttons.
+-langid = wx.LANGUAGE_DEFAULT # Picks this up from $LANG
+-mylocale = wx.Locale( langid )
+-
+ from pubsub import *
+ from wxgui import ps
+ 
+diff --git a/fontypythonmodules/gui_ScrolledFontView.py b/fontypythonmodules/gui_ScrolledFontView.py
+index d7b3d2f..3e35d62 100644
+--- a/fontypythonmodules/gui_ScrolledFontView.py
++++ b/fontypythonmodules/gui_ScrolledFontView.py
+@@ -20,10 +20,6 @@ import wx.lib.scrolledpanel
+ 
+ from pubsub import *
+ 
+-## Setup wxPython to access translations : enables the stock buttons.
+-langid = wx.LANGUAGE_DEFAULT # Picks this up from $LANG
+-mylocale = wx.Locale( langid )
+-
+ import fpsys # Global objects
+ 
+ from gui_Fitmap import * #Also brings in 'ps' variable
+diff --git a/fontypythonmodules/wxgui.py b/fontypythonmodules/wxgui.py
+index da80d17..6e6716a 100644
+--- a/fontypythonmodules/wxgui.py
++++ b/fontypythonmodules/wxgui.py
+@@ -23,10 +23,6 @@ import fpversion
+ ## Now, bring in all those big modules
+ import wx
+ 
+-## Setup wxPython to access translations : enables the stock buttons.
+-langid = wx.LANGUAGE_DEFAULT # Picks this up from $LANG
+-mylocale = wx.Locale( langid )
+-
+ ## Fetch my own pubsub stuff
+ from pubsub import *
+ ps = CPubsub()
diff -Nru fontypython-0.4.4/debian/patches/0003-Adapt-to-wxpython-3.0-which-enforces-assertions-on-L.patch fontypython-0.4.4/debian/patches/0003-Adapt-to-wxpython-3.0-which-enforces-assertions-on-L.patch
--- fontypython-0.4.4/debian/patches/0003-Adapt-to-wxpython-3.0-which-enforces-assertions-on-L.patch	1970-01-01 01:00:00.000000000 +0100
+++ fontypython-0.4.4/debian/patches/0003-Adapt-to-wxpython-3.0-which-enforces-assertions-on-L.patch	2014-12-21 22:49:18.000000000 +0100
@@ -0,0 +1,28 @@
+From: Pietro Battiston <m...@pietrobattiston.it>
+Date: Sun, 21 Dec 2014 11:50:09 +0100
+Subject: Adapt to wxpython 3.0, which enforces assertions on ListItems ids.
+
+---
+ fontypythonmodules/gui_PogChooser.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/fontypythonmodules/gui_PogChooser.py b/fontypythonmodules/gui_PogChooser.py
+index c679191..4cdf772 100644
+--- a/fontypythonmodules/gui_PogChooser.py
++++ b/fontypythonmodules/gui_PogChooser.py
+@@ -200,6 +200,7 @@ class PogChooser(wx.ListCtrl) :
+ 			li.SetImage(i) 
+ 			li.SetText(p) 
+ 			id = wx.NewId()
++			li.SetId(id)
+ 			PogChooser.__poglistCopy[id] = p # record the pog name
+ 			row = self.InsertItem( li ) 
+ 			self.SetItemData( row, id ) # associate back to __poglistCopy
+@@ -214,6 +215,7 @@ class PogChooser(wx.ListCtrl) :
+ 		li.SetImage(0)
+ 		li.SetText(pogname)
+ 		id = wx.NewId()
++		li.SetId(id)
+ 		self.__poglistCopy[id] = pogname 
+ 		row = self.InsertItem(li)
+ 		self.SetItemData( row, id )
diff -Nru fontypython-0.4.4/debian/patches/series fontypython-0.4.4/debian/patches/series
--- fontypython-0.4.4/debian/patches/series	2014-12-21 23:05:39.000000000 +0100
+++ fontypython-0.4.4/debian/patches/series	2014-12-21 22:49:18.000000000 +0100
@@ -1 +1,3 @@
-0001-Select-wx-2.8-rather-than-3.0.patch
+0001-Do-not-crash-on-empty-pogs-list.patch
+0002-Removed-unused-code-which-causes-crash-with-wx-3.0.patch
+0003-Adapt-to-wxpython-3.0-which-enforces-assertions-on-L.patch

Reply via email to