Re: Documentation on new data model for Leo outlines

2018-05-17 Thread Matt Wilkie

>
> > > col = (pos.x - grid.minx) / (grid.maxx - grid.minx) * grid.cols 
> > > 
> > +10! 
>
> Given the +10 :) I should add I've been using this lib.: 
>
> https://pypi.org/project/addict/#description 
>
 
Thanks!

-- 
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation on new data model for Leo outlines

2018-05-17 Thread Matt Wilkie

>
> I have just published first two articles about what I have done so far in 
> this mini-project. Here are the links:
>
 [...]

> All comments are welcome.
>
 
Vitalije, I'm working my through your posts on that site from the 
beginning. It's slow because I understand little because of my shallow 
coding background. However I want to say that enjoy them and learn things. 
Top of mind at the moment is your recognition that your initial attempts to 
communicate an idea didn't work and that a) building a demo might be 
effective, and b) choosing something that wasn't currently in discussion 
but had been before would invite deeper inspection and involvement. 

Thanks,

Matt

-- 
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation on new data model for Leo outlines

2018-05-17 Thread Terry Brown
On Thu, 17 May 2018 12:00:30 -0700 (PDT)
Matt Wilkie  wrote:

> > Veering off topic I wish there was a more general solution for dot
> > access to dict members, I understand all the arguments against, but
> > often writing mathematical expressions...
> > 
> > col = (pos['x'] - grid['minx']) / (grid['maxx'] - grid['minx']) *
> > grid['cols']
> > 
> > vs.
> > 
> > col = (pos.x - grid.minx) / (grid.maxx - grid.minx) * grid.cols
> > 
> +10!

Given the +10 :) I should add I've been using this lib.:

https://pypi.org/project/addict/#description

I would have picked a different name, but `pip install addict` is
easier than managing my own copy / version of this functionality.

A minor point, I did notice that

d = Dict(aDict)

seems to deepcopy aDict, whereas

d = Dict()
d.update(aDict)

behaves as expected (altering values in d alters the corresponding
value in aDict).

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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation on new data model for Leo outlines

2018-05-17 Thread Matt Wilkie
the rest of this thread is over my head, but:

Veering off topic I wish there was a more general solution for dot 
> access to dict members, I understand all the arguments against, but 
> often writing mathematical expressions... 
>
> col = (pos['x'] - grid['minx']) / (grid['maxx'] - grid['minx']) * 
> grid['cols'] 
>
> vs. 
>
> col = (pos.x - grid.minx) / (grid.maxx - grid.minx) * grid.cols 
>

+10! 

-- 
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Looking over my should while I add support for jedi autocompletion

2018-05-17 Thread Edward K. Ream
On Thursday, May 17, 2018 at 5:59:17 AM UTC-5, Edward K. Ream wrote:

The node's local line number (and corresponding line) must be reconciled 
> exactly with the global sources returned by 
> goto.get_external_file_with_sentinels.
>

Experiment 6 
 
adds finicky row/column adjustments.  All seems well now and jedi appears 
to return the expected completions. It's important to pass the entire 
external file to jedi, not just a single node.

That's all the work I plan for now.  When I return I'll knit the code into 
leoKeys.py.

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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Looking over my should while I add support for jedi autocompletion

2018-05-17 Thread Edward K. Ream


On Thursday, May 17, 2018 at 5:11:32 AM UTC-5, Edward K. Ream wrote:

The last comment shows @button jedi, which does everything except actually 
> calling jedi to get the completions.
>

The node's local line number (and corresponding line) must be reconciled 
exactly with the global sources returned by 
goto.get_external_file_with_sentinels. Otherwise jedi will be working on 
completions in the wrong line and will likely throw an IndexError when 
computing the column.

It should be easy to *detect* any mismatch.  The corresponding lines won't 
be the same. The trick is to make sure the lines are always identical. Not 
sure I'll get this exactly right before my trip.

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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Away until Monday

2018-05-17 Thread Edward K. Ream
Rebecca and I are traveling to Seattle later today to attend our daughter 
Linda's wedding :-)

I'll have my laptop with me for emergencies, but I expect none.

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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Looking over my should while I add support for jedi autocompletion

2018-05-17 Thread Edward K. Ream
On Wednesday, May 16, 2018 at 10:21:00 AM UTC-5, Edward K. Ream wrote:
>
> Chris George said he would like to look over my shoulder while I do #309: Add 
> support for Jedi autocompletion. 
> 
>

The comments in #309 now show how I developed the Leo-specific 
infrastructure needed to convert node structure into a flat "source" string 
suitable for jedi.  The last comment shows @button jedi, which does 
everything except actually calling jedi to get the completions.

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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.