quicksearch - Nav tab hard crashes Leo

39 views
Skip to first unread message

lewis

unread,
Oct 28, 2015, 8:52:06 AM10/28/15
to leo-editor
Select the "Nav" tab, enter search text into the window and press enter.
Leo crashes completely with this in the console:

[snip]
** isPython3: True
Leo 5.1-final, build 20151027155247, Tue Oct 27 15:52:47 CDT 2015
Git repo info: branch = master, commit = e4dc0c93de13
Python 3.4.3, PyQt version 5.5.1
Windows 7 AMD64 (build 6.1.7601) SP1
reading settings in c:\Users\lewis\.leo\myLeoSettings.leo
Traceback (most recent call last):
  File "n:\git\leo-editor\leo\plugins\quicksearch.py", line 356, in returnPresse
d
    self.scon.doSearch(t)
  File "n:\git\leo-editor\leo\plugins\quicksearch.py", line 602, in doSearch
    lineMatchHits = self.addParentMatches(parents)
  File "n:\git\leo-editor\leo\plugins\quicksearch.py", line 498, in addParentMat
ches
    for parent_key, parent_value in parent_list.iteritems():
AttributeError: 'OrderedDefaultDict' object has no attribute 'iteritems'
[end]

Regards
Lewis

john lunzer

unread,
Oct 28, 2015, 8:58:47 AM10/28/15
to leo-editor
Python3 doesn't have iteritems because they made everything iterators by default so that iteritems is just items. I guess I can just use items and deal with the increased memory footprint for Python2. 

john lunzer

unread,
Oct 28, 2015, 9:20:30 AM10/28/15
to leo-editor
Okay, I just pushed the fix upstream. Sorry for not testing on Python3!

lewis

unread,
Oct 28, 2015, 9:28:38 AM10/28/15
to leo-editor
Hi John,

Appreciate the quick response. I just tested again and Leo survives pressing enter and a list of hits is presented. If I select a hit Leo crashes.


** isPython3: True
Leo 5.1-final, build 20151027155247, Tue Oct 27 15:52:47 CDT 2015
Git repo info: branch = master, commit = 7037cdd07abf

Python 3.4.3, PyQt version 5.5.1
Windows 7 AMD64 (build 6.1.7601) SP1
reading settings in N:\leo\workbook.leo

Traceback (most recent call last):
  File "n:\git\leo-editor\leo\plugins\quicksearch.py", line 693, in onSelectItem

    modifiers = QtGui.QApplication.keyboardModifiers()
AttributeError: 'module' object has no attribute 'QApplication'
[end]

Lewis

john lunzer

unread,
Oct 28, 2015, 9:54:19 AM10/28/15
to leo-editor
Okay, this was caused by moving QApplication from QtGui in PyQt4 to QtWidgets in PyQt5. Newest commit should fix it, though I can't test it myself. Please let me know if this clears things up!

Terry Brown

unread,
Oct 28, 2015, 10:54:17 AM10/28/15
to leo-e...@googlegroups.com
On Wed, 28 Oct 2015 06:54:18 -0700 (PDT)
john lunzer <lun...@gmail.com> wrote:

> Okay, this was caused by moving QApplication from QtGui in PyQt4 to
> QtWidgets in PyQt5. Newest commit should fix it, though I can't test
> it myself. Please let me know if this clears things up!

Ha, decided to run py3 / qt5 just to see where things were at, and
found the same bug in the de-clutter code, so fixed that. I don't see
any issues with 8a0ca9602 for py3 / qt5 Nav except I'm not sure if
keyboard focus is working as it should, seems in py27 / qt 4
hitting enter after typing the search target gives keyboard focus to
the Nav list allowing arrow key navigation, but in py3 / qt5 focus goes
to the body. Annoying when qt behaviors differ that way.

Cheers -Terry

lewis

unread,
Oct 29, 2015, 7:02:31 AM10/29/15
to leo-editor
Nav tab is working again. Thanks for the fix.

Lewis
Reply all
Reply to author
Forward
0 new messages