Re: How to launch Leo via pythonw.exe with an Anaconda environment but without an extra console window?

2018-11-06 Thread Arjan
That's basically what I use in my .bat which I launch from CLI with 
Anaconda env active. But it doesn't work as a shortcut because it's lacking 
the right environment.

On Tuesday, November 6, 2018 at 5:26:58 AM UTC+1, huliuhe wrote:
>
> write a bat file , the content is :
>
> start C:\Programs\Anaconda3\pythonw.exe 
> "C:\Programs\Leo-editor\launchLeo.py"
>
> 在 2018年11月4日星期日 UTC+8下午7:24:05,Arjan写道:
>

-- 
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.


Not Leo in Flexx

2018-11-06 Thread Terry Brown
I could have sworn I'd posted about this, but can't find the post - I'd
be curious if anyone remembered a posting along these lines.  Pffft.

For a while (since Aug. 9 2018 according to git) I've been fiddling
with a Flexx based app. that is Leo like.  But not Leo.  It's an
experiment with a different data model (VDCG, Vaguely Directed Cyclic
Graphs).  Nodes / edges are stored in a DB.  Edges belong to sets, or
graphs.  Nodes can occur in multiple graphs.  Sort of sea of nodes /
colored threads / Kent's extra dimensions (maybe).  So when you want
the list of children for a node, you have to specify the graph, a node
has a different set of children in each graph.

The initial question is can you navigate this using a tree?  So I have
a tree widget that supports moving nodes, and string widgets to edit
the name and "body" of the node.  Data on a node is generalized as a
dict / JSON string, so nodes having a head / body is an option, not a
requirement.  Fiddling with questions about whether you should see
nodes from two or more graphs under a node at the same time, etc.

App. components aren't directly connected, they broadcast messages that
other components can react to, or not.  Insert node, for example,
broadcasts a msg. ('insert_node') from the JS tree component.  The
"core" (Python) component hears that, changes the DB, and broadcasts a
msg. ('node_inserted') telling any listening widgets about that change.

Leaving a lot of rough edges (focus, can't manipulate top level nodes,
keyboard nav. of tree etc.) while I try and work out if this model
(VDCG) is usable.

No particular point to this message other than that I could have sworn
I'd written this before, but see no evidence that that's the case.

Tangentially, I've also been using vim a lot for day to day work.  I
see the Ace editor has a vim keyboard mode.

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: Status report: learning flexx

2018-11-06 Thread Edward K. Ream
On Tuesday, November 6, 2018 at 5:12:24 AM UTC-6, Edward K. Ream wrote:

Note:  The code above is valid pscript only if it is on the python side.  
> Pscript for JS does not support the necessary generator, so it would have 
> to be this instead:
>
> def make_outline_list(c):
> result = []
> for p in c.all_positions():
> result.append((p.archivedPosition(), p.h),)
> return result
>

 Just to be clear, make_outline_list *must* be on the python side.  
However, similar code will be needed to convert JS data to Leo data, and 
that code can't use generators inside list comprehensions.

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.


Status report: learning flexx

2018-11-06 Thread Edward K. Ream
The short summary: flexx is starting to make sense to me.  It looks like 
the perfect fit for LeoWapp (Leo as a web app). There is already a working 
prototype, but some important questions remain.

This post contains implementation details, so feel free to ignore all that 
follows.

*Getting the feel of flexx*

There is no substitute for making mistakes, over and over again, until a 
mental model forms.  The flexx docs are good, but experience is paramount. 
Several salient facts that have sunk in:

1. Pscript implies magic.  The magic (transcriptions) happens as the 
Tornado starts up.  Without errors, startup looks like:

[a64] c:\leo.repo\leo-editor>python c:\leo.repo\leo-editor\leo\plugins\
leoflexx.py --flexx-webruntime=browser
[I 02:10:49 flexx.app] Asset store collected 2 new modules.
[I 02:10:52 flexx.app] Serving apps at http://localhost:49190/
[I 02:10:52 flexx.app] Asset store collected 23 new modules.
[I 02:10:53 flexx.app] Starting Flexx event loop.
[I 02:10:54 flexx.app] New session LeoMainWindow 5EIbB2gUYw4YOnBZ4LpPRBuM

With errors, startup looks like:

[a64] c:\leo.repo\leo-editor>python c:\leo.repo\leo-editor\leo\plugins\
leoflexx.py --flexx-webruntime=browser
[I 04:48:36 flexx.app] Asset store collected 2 new modules.
[I 04:48:38 flexx.app] Serving apps at http://localhost:49190/
[I 04:48:38 flexx.app] Asset store collected 23 new modules.
Traceback (most recent call last):
[snip]

2. The python and JS (javascript) parts of flexx/pscript are two very 
different beasts, though they both look like plain python.

*No subclasses of flx.Widget can possibly access Leo's c or p classes, 
because the code is actually JS.*

3. Pscript "collects" javascript code (see above, but details unclear), so 
code that might look like python code is actually JS code.

As a result, if would be useful if more of the code could lean towards 
python 
.
  
I have run into problems doing this, and have filed this issue 
 on the flexx issue tracker. 
I've already gotten a reply, but I doubt that I can avoid some hacks.

*Data translation*

JS can never access c, so translating data to/from python will *always *be 
necessary.  This is quite easy to do.  Here is the present top-level 
function that converts a Leo outline to something that JS can handle:

def make_outline_list(c):
return [(p.archivedPosition(), p.h) for p in c.all_positions()]

p.archivedPosition() returns a list of ints, the child-index field of the 
node and its parents.  Top-level nodes are [0], [1], etc., children of the 
first node are [0, 0], [0, 1], and so on.  So this serializable into json 
or flexx dicts.

make_outline_list will soon return tuples including p.gnx, which is a 
string.

Note:  The code above is valid pscript only if it is on the python side.  
Pscript for JS does not support the necessary generator, so it would have 
to be this instead:

def make_outline_list(c):
result = []
for p in c.all_positions():
result.append((p.archivedPosition(), p.h),)
return result

*Still to do*

A great deal of work remains:

1. Almost all events must be generated and handled.  One important 
milestone will be having c.frame.log output show up in the *browser's* log 
widget.

2. It's too slow to load tree all at once. Eventually, the code will load 
subtrees only as they become visible.

3. A major project: supporting Leo's key bindings.

And many other details.

*Summary*

I am beginning to grok flexx and pscript.  I have started a friendly dialog 
with Almar Klein , the author of flexx and 
pyzo.

Lots and lots of work remains.

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.