Sun 12 Nov 2017 07:53:59 AM UTC, comment #1:
FichteFoll,
Thanks for the ticket! I am in a cycle of updating Fonty and it was well-timed.
I can't believe the bug has been there all along! How did users start with no pogs before? Sheesh. Testing state on this little gui project is almost impossible for me. (I'm not a pro programmer.) I have such respect for other's code now; I tell you!
I have stuck an if around the bug, and tested it. That's fixed now. Credit to you, of course.
The pdb.set_trace is gone in my latest branch. It's part of debugging.
I've been getting segfaults in the underlying C++ wxwidgets (I think) library when I use sizers. As a result, I've spent a month ripping them out and re-doing the gui.
As to putting Fonty on AUR. Sure. Is that Arch Linux? I had to do a quick search. I know it was on Fedora/rpm a few years ago.
You might want to hold-off a while. I am very busy on the new version. I hope to have it done by Dec/Jan.
I can't move to Python 3 yet because wxPython's new version 4 (Phoenix, they call it) is not in any Linux repos yet. Therefore, Fonty is in a strange zone where Python 2.x is being removed from repos.
(I have not even tried Python 3 myself, so it's a small relief!)
Factor that all in as you must.
Perhaps I can bother you to do a few test runs in a month or so? I don't know many people out there to ask. You can get me on -unavailable-
Thanks for the help,
/d
|
Sat 11 Nov 2017 06:23:17 PM UTC, original submission:
The first time I tried to run this (trunk version), I was greeted with an exception from a Select call. The traceback is as follows:
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_misc.py", line 1367, in Notify
self.notify()
File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 16865, in Notify
self.result = self.callable(self.args, *self.kwargs)
File "/usr/lib/python2.7/site-packages/fontypythonmodules/wxgui.py", line 487, in showMain
frame = MainFrame(None, _("Fonty Python: bring out your fonts!"))
File "/usr/lib/python2.7/site-packages/fontypythonmodules/wxgui.py", line 184, in _init_
self.nb = NoteBook(self.panelNotebook, name="notebook")
File "/usr/lib/python2.7/site-packages/fontypythonmodules/gui_Left.py", line 132, in _init_
self.ctrlPogSource = PogChooser(pan2, whoami="SOURCEPOG", select = s)
File "/usr/lib/python2.7/site-packages/fontypythonmodules/gui_PogChooser.py", line 93, in _init_
self.Select(0, False)
File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_controls.py", line 4766, in Select
self.SetItemState(idx, state, wx.LIST_STATE_SELECTED)
File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_controls.py", line 4529, in SetItemState
return controls.ListCtrl_SetItemState(args, *kwargs)
wx._core.PyAssertionError: C++ assertion "litem >= 0 && (size_t)litem < GetItemCount()" failed at ./src/generic/listctrl.cpp(3422) in SetItemState(): invalid list ctrl item index in SetItem
I was able to fix this by uncommenting the described line in gui_PogChooser.py:
## Highlight the pog selected (the last one, or the cli chosen one)
if select:
i = self.FindItem(-1, select)
self.indexselected = i # Set this to help initial icon settings.
self.Select(i, True)
else:
# self.Select(0, False) # <- this one
self.indexselected = -1
I suspect that the code doesn't consider the case when there are no pogs at the first launch, which wxWidgeds rightfully complains about.
Furthermore, there is a pdb.set_trace call in fontyfilter.py:29 which I believe shouldn't be there.
Just for your information, after the issue is resolved, I'd like to submit fontypython to the AUR for easy installation by others. You can contact me on freenode as "FichteFoll", if you need to.
|