Re: Weird autocompleter bug

2014-08-10 Thread Edward K. Ream
On Sun, Aug 10, 2014 at 1:23 AM, Fidel N  wrote:
> The autocompleter works normally for me now.

Glad to hear it.  Thanks for the confirmation.

However, as I stated earlier, I'm not so much worried about what I
have tested, as what I haven't ;-)

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-09 Thread Fidel N
The autocompleter works normally for me now.
Thanks Edward.


On Sat, Aug 9, 2014 at 11:00 PM, Edward K. Ream  wrote:

> On Sat, Aug 9, 2014 at 11:19 AM, Edward K. Ream 
> wrote:
>
> > So the mystery of my rollback of leoAtFile.py didn't solve the problem
> > is completely explained. Still, some care will be required.  I'll fix
> this later today...
>
> Fixed.  Maybe.  Here is the checkin log for rev 90a0531...
>
> QQQ
> Revert to old code that imports plugins/writers and plugins/importers
> using importlib.import_module.
> This causes autocompleters for c.whatever to work.
> All tests pass, pylint is happy, and the writers and importers appear
> to work, but I have the feeling I am missing something...
> QQQ
>
> I should have said also that docutils appears to work.  So I have
> tried every test that comes to mind, but I have the feeling there
> could be problems.  After all, there may have been a reason for the
> change to the code.  Heh, heh.
>
> Otoh, as part of the new commit, I improved the tests for duplicate
> classes: no warning is given if the old and new entries in
> ic.atAutoDict are the same.  This is expected because Leo reads some
> .leo files twice.  Maybe what happened is that I was overly worried
> about the messages and went to too-extreme lengths to avoid them.
>
> In short, the new code is an experiment.  Please report your
> experience, for good or ill...
>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+unsubscr...@googlegroups.com.
> To post to this group, send email to leo-editor@googlegroups.com.
> Visit this group at http://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-09 Thread Edward K. Ream
On Sat, Aug 9, 2014 at 11:19 AM, Edward K. Ream  wrote:

> So the mystery of my rollback of leoAtFile.py didn't solve the problem
> is completely explained. Still, some care will be required.  I'll fix this 
> later today...

Fixed.  Maybe.  Here is the checkin log for rev 90a0531...

QQQ
Revert to old code that imports plugins/writers and plugins/importers
using importlib.import_module.
This causes autocompleters for c.whatever to work.
All tests pass, pylint is happy, and the writers and importers appear
to work, but I have the feeling I am missing something...
QQQ

I should have said also that docutils appears to work.  So I have
tried every test that comes to mind, but I have the feeling there
could be problems.  After all, there may have been a reason for the
change to the code.  Heh, heh.

Otoh, as part of the new commit, I improved the tests for duplicate
classes: no warning is given if the old and new entries in
ic.atAutoDict are the same.  This is expected because Leo reads some
.leo files twice.  Maybe what happened is that I was overly worried
about the messages and went to too-extreme lengths to avoid them.

In short, the new code is an experiment.  Please report your
experience, for good or ill...

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-09 Thread Edward K. Ream
On Sat, Aug 9, 2014 at 11:10 AM, Edward K. Ream  wrote:

Ach.  I see why the git bisect was so dashed confusing.  The commit
that caused the problems changed *two* files, leoAtFile.py and
leoImport.py.

Somehow, I didn't see the change to leoImport.py, but now, from first
principles, it's clear that it was the change to ic.createImporterData
that caused the problem, *not* the change to at.createWritersData.

So the mystery of my rollback of leoAtFile.py didn't solve the problem
is completely explained.

Still, some care will be required.  I'll fix this later today...

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-09 Thread Edward K. Ream
On Sat, Aug 9, 2014 at 8:24 AM, Edward K. Ream  wrote:

> I'll attempt a fix today.

I inserted a trace in AutoCompleterClass.get_leo_namespace::

def get_leo_namespace (self,prefix):
'''
Return an environment in which to evaluate prefix.
Add some common standard library modules as needed.
'''
trace = True and not g.unitTesting
k = self.k
d = {'c':k.c, 'p':k.c.p, 'g':g}
aList = prefix.split('.')
if len(aList) > 1:
name = aList[0]
m = sys.modules.get(name)
if m:
d[name]= m
if trace:
g.trace('prefix',prefix,'aList',aList)
for key in sorted(d.keys()):
g.trace(key,d.get(key))
return

Here is what it reported (minus the leading method name)::

prefix c. aList [u'c', u'']
c 
g 
p 

So now it's clear what is happening: the module defined in
leo/plugins/importers/c.py is polluting the global namespace.  That
is, it is entered into sys.modules as "c" rather than
"leo.plugins.importers.c".

You would think it would be easy to change that, but as I recall there
is a problem with rst.py.  It, at least, must be entered "bare", or
docutils will barf. Big sigh.

I think Leo must special case rst.py.  Btw, there is already a special
case for docutils, the importer is leo.plugins.importers.leo_rst.

I'll have to think about this...

Edward
--
Edward K. Ream: edream...@gmail.com Leo: http://leoeditor.com/
Speak the truth, but not to punish--Thich Nhat Hanh
--

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-09 Thread Edward K. Ream
On Fri, Aug 8, 2014 at 10:00 AM, Fidel N  wrote:
> well ill wait till "c." completes well then try to find out the difference,
> but I really trust when the other thing is fixed this also will.

I'll attempt a fix today.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread Fidel N
well ill wait till "c." completes well then try to find out the difference,
but I really trust when the other thing is fixed this also will.
Thanks


On Fri, Aug 8, 2014 at 4:58 PM, 'Terry Brown' via leo-editor <
leo-editor@googlegroups.com> wrote:

> On Fri, 8 Aug 2014 09:39:42 -0500
> "Edward K. Ream"  wrote:
>
> > On Fri, Aug 8, 2014 at 8:06 AM, Fidel N  wrote:
> > > And when trying to complete "c.p." no autocompletion appears, and
> > > this error pops up in the log pane:
> >
> > Not for me.  I suspect this only happens when using the Qt-base
> > auto-completer widget.
> >
> > EKR
>
> The Qt widget's working for me.
>
> Cheers -Terry
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+unsubscr...@googlegroups.com.
> To post to this group, send email to leo-editor@googlegroups.com.
> Visit this group at http://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread 'Terry Brown' via leo-editor
On Fri, 8 Aug 2014 09:39:42 -0500
"Edward K. Ream"  wrote:

> On Fri, Aug 8, 2014 at 8:06 AM, Fidel N  wrote:
> > And when trying to complete "c.p." no autocompletion appears, and
> > this error pops up in the log pane:
> 
> Not for me.  I suspect this only happens when using the Qt-base
> auto-completer widget.
> 
> EKR

The Qt widget's working for me.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread Edward K. Ream
On Fri, Aug 8, 2014 at 8:06 AM, Fidel N  wrote:
> And when trying to complete "c.p." no autocompletion appears, and this error
> pops up in the log pane:

Not for me.  I suspect this only happens when using the Qt-base
auto-completer widget.

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread Edward K. Ream
On Fri, Aug 8, 2014 at 8:02 AM, Fidel N  wrote:
> Thanks for the fix, but I think it doesnt work yet:
>
> Doing "c." will lead to autocompleter still completing wrong.
> Options such as "p", "redraw", etc just dont appear.
> "baseescanner" still appears as an option.

I agree.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread 'Terry Brown' via leo-editor
On Fri, 8 Aug 2014 07:39:21 -0500
"Edward K. Ream"  wrote:

> On Thu, Aug 7, 2014 at 9:02 AM, 'Terry Brown' via leo-editor
>  wrote:
> 
> > Phew :-} not me https://github.com/leo-editor/leo-editor/issues/40
> 
> Rev d343dde... rolls back the code.
> 
> I'm not happy with the old code, and the autocompleter still doesn't
> seem to do a good job.  For example, I expect c.frame.body.body
> to show bodyCtrl in the completions.  It doesn't.
> 
> Terry, please see if any of your recent changes are involved.  Thanks.

p.s. so I don't think your rollback worked - like
c.fram, c.frame.body.body completes as expected up to 

91fd345 Edward K. Ream 2014-07-30 09:34:11

but not after

e717fc0 Edward K. Ream 2014-07-30 13:59:30

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread 'Terry Brown' via leo-editor
On Fri, 8 Aug 2014 07:39:21 -0500
"Edward K. Ream"  wrote:

> On Thu, Aug 7, 2014 at 9:02 AM, 'Terry Brown' via leo-editor
>  wrote:
> 
> > Phew :-} not me https://github.com/leo-editor/leo-editor/issues/40
> 
> Rev d343dde... rolls back the code.
> 
> I'm not happy with the old code, and the autocompleter still doesn't
> seem to do a good job.  For example, I expect c.frame.body.body
> to show bodyCtrl in the completions.  It doesn't.
> 
> Terry, please see if any of your recent changes are involved.  Thanks.

I don't think so.  My changes were

9468786 tbnorth 2014-07-19 11:21:34
c7ece27 tbnorth 2014-07-19 11:20:37

my test case is loading a small outline with a body containing "c.fram"
and auto completing on that.

That works (single completion, 'c.frame') up to

91fd345 Edward K. Ream 2014-07-30 09:34:11

but fails (no c.frame, so other spurious completions) on the next commit

e717fc0 Edward K. Ream 2014-07-30 13:59:30

and still fails as above on

d343dde Edward K. Ream 2014-08-08 07:35:19

I tried using `git revert`, but it only worked on d343dde, not e717fc0,
which generated conflicts, and also deleted leo_rst.py.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread Fidel N
And when trying to complete "c.p." no autocompletion appears, and this 
error pops up in the log pane:


exception executing command
Traceback (most recent call last):
  File "D:\leo-editor\leo\core\leoCommands.py", line 539, in doCommand
val = command(event)
  File "D:\leo-editor\leo\core\leoKeys.py", line 215, in autoComplete
self.start(event)
  File "D:\leo-editor\leo\core\leoKeys.py", line 1091, in start
self.init_qcompleter(event)
  File "D:\leo-editor\leo\core\leoKeys.py", line 936, in init_qcompleter
self.exit()
  File "D:\leo-editor\leo\core\leoKeys.py", line 309, in exit
self.qw.end_completer()
  File "D:\leo-editor\leo\plugins\qtGui.py", line 333, in end_completer
self.leo_qc.end_completer()
  File "D:\leo-editor\leo\plugins\qtGui.py", line 140, in end_completer
self.deleteLater()
RuntimeError: wrapped C/C++ object of type LeoQListWidget has been deleted

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread Fidel N
Thanks for the fix, but I think it doesnt work yet:

Doing "c." will lead to autocompleter still completing wrong.
Options such as "p", "redraw", etc just dont appear.
"baseescanner" still appears as an option.


On Fri, Aug 8, 2014 at 2:39 PM, Edward K. Ream  wrote:

> On Thu, Aug 7, 2014 at 9:02 AM, 'Terry Brown' via leo-editor
>  wrote:
>
> > Phew :-} not me https://github.com/leo-editor/leo-editor/issues/40
>
> Rev d343dde... rolls back the code.
>
> I'm not happy with the old code, and the autocompleter still doesn't
> seem to do a good job.  For example, I expect c.frame.body.body
> to show bodyCtrl in the completions.  It doesn't.
>
> Terry, please see if any of your recent changes are involved.  Thanks.
>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+unsubscr...@googlegroups.com.
> To post to this group, send email to leo-editor@googlegroups.com.
> Visit this group at http://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-08 Thread Edward K. Ream
On Thu, Aug 7, 2014 at 9:02 AM, 'Terry Brown' via leo-editor
 wrote:

> Phew :-} not me https://github.com/leo-editor/leo-editor/issues/40

Rev d343dde... rolls back the code.

I'm not happy with the old code, and the autocompleter still doesn't
seem to do a good job.  For example, I expect c.frame.body.body
to show bodyCtrl in the completions.  It doesn't.

Terry, please see if any of your recent changes are involved.  Thanks.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-07 Thread Zoltan Benedek
May be related:

https://github.com/leo-editor/leo-editor/issues/38

On Thursday, August 7, 2014 4:37:07 PM UTC+3, Fidel N wrote:
>
> Hi all:
> Just realized that when doing
> "c." and checking the autocompleter options it wont offer the usual 
> (p,etc) but offers things like:
>
> CScanner
> basescanner
>
> and a few more.
> Anyone having this issue?
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-07 Thread Fidel N
hehe thx for reporting :D


On Thu, Aug 7, 2014 at 4:02 PM, 'Terry Brown' via leo-editor <
leo-editor@googlegroups.com> wrote:

> On Thu, 7 Aug 2014 08:40:50 -0500
> "'Terry Brown' via leo-editor"  wrote:
>
> > On Thu, 7 Aug 2014 06:37:07 -0700 (PDT)
> > Fidel N  wrote:
> >
> > > Hi all:
> > > Just realized that when doing
> > > "c." and checking the autocompleter options it wont offer the usual
> > > (p,etc) but offers things like:
> > >
> > > CScanner
> > > basescanner
> > >
> > > and a few more.
> > > Anyone having this issue?
> >
> > I'll check it, I did touch that code recently.
>
> Phew :-} not me https://github.com/leo-editor/leo-editor/issues/40
>
> Cheers -Terry
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+unsubscr...@googlegroups.com.
> To post to this group, send email to leo-editor@googlegroups.com.
> Visit this group at http://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-07 Thread 'Terry Brown' via leo-editor
On Thu, 7 Aug 2014 08:40:50 -0500
"'Terry Brown' via leo-editor"  wrote:

> On Thu, 7 Aug 2014 06:37:07 -0700 (PDT)
> Fidel N  wrote:
> 
> > Hi all:
> > Just realized that when doing
> > "c." and checking the autocompleter options it wont offer the usual
> > (p,etc) but offers things like:
> > 
> > CScanner
> > basescanner
> > 
> > and a few more.
> > Anyone having this issue?
> 
> I'll check it, I did touch that code recently.

Phew :-} not me https://github.com/leo-editor/leo-editor/issues/40

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-07 Thread 'Terry Brown' via leo-editor
On Thu, 7 Aug 2014 06:37:07 -0700 (PDT)
Fidel N  wrote:

> Hi all:
> Just realized that when doing
> "c." and checking the autocompleter options it wont offer the usual
> (p,etc) but offers things like:
> 
> CScanner
> basescanner
> 
> and a few more.
> Anyone having this issue?

I'll check it, I did touch that code recently.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Weird autocompleter bug

2014-08-07 Thread Jacob M. Peck

Same here.
-->Jake

On 8/7/2014 9:37 AM, Fidel N wrote:

Hi all:
Just realized that when doing
"c." and checking the autocompleter options it wont offer the usual 
(p,etc) but offers things like:


CScanner
basescanner

and a few more.
Anyone having this issue?
--
You received this message because you are subscribed to the Google 
Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to leo-editor+unsubscr...@googlegroups.com 
.
To post to this group, send email to leo-editor@googlegroups.com 
.

Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.