Leo on FreeBSD

2018-10-29 Thread Chris George


I am trying to see if Leo will run on FreeBSD.

So far, so excellent. Python rocks.

Python 2.7.15, PyQt version 5.10.1

Python 3.6.6, PyQt version 4.8.7
freeBSD12
isPython3: True

I expect gotchas in the future but this will allow me to move my life away 
from Linux.

Chris

-- 
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: LeoWapp will use WebSockets and Python 3

2018-10-29 Thread Edward K. Ream
On Monday, October 29, 2018 at 11:06:38 AM UTC-5, Edward K. Ream wrote:

the client.py and server.py shown here 
> do 
> work...I'll see what happens on Windows.
>

Hurray!  Works just fine on Windows 10.

The next step will be to look at using a javascript client in the browser.

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: LeoWapp will use WebSockets and Python 3

2018-10-29 Thread Edward K. Ream
On Mon, Oct 29, 2018 at 9:05 AM Edward K. Ream wrote:

> I have not had any joy with various basic WebSockets examples on Windows.

Some of the basic python-only examples don't seem to do anything on Ubuntu.
Happily, the client.py and server.py shown here
do work.  This
is important progress.  I'll see what happens on Windows shortly.

Googling indicates that firewalls should not typically get in the way.
Indeed, the working examples on Ubuntu use ws://localhost:8765.

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: Recommended place to store common functions?

2018-10-29 Thread Edward K. Ream
On Mon, Oct 29, 2018 at 10:19 AM Sapphira Armageddos wrote:

Hello Sapphira.  Welcome aboard.

what's considered best coding practice for storing Leo specific python code
> that I'd reuse elsewhere?
>

Good question.  There are several ways to reuse code:

1. You can define abbreviations.  This lets you insert code, but not
execute it.

Abbreviations can expand to trees, so you aren't limited.  You would
typically store them in myLeoSettings.leo, (open with the my-leo-settings
command) the one of these nodes:

@data global-abbreviations
@outline-data tree-abbreviations

See leoSettings.leo for details.

2. Any @button or @command node defined in myLeoSettings.leo will be
available in all open outlines:

- @b shows the list of @button commands.
- @c shows the list of @command commands.

3. You can dump code into, say, scripts.leo.  Open with leo-scripts-leo.

4. Or define @command open-my-scripts this way:

g.openWithFileName('')

HTH.

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.


Recommended place to store common functions?

2018-10-29 Thread Sapphira Armageddos
Hi everyone!

Been using Leo for a while and I love it. One thing that alludes me is - 
what's considered best coding practice for storing Leo specific python code 
that I'd reuse elsewhere? For instance, sometimes I have outline specific 
commands that make call the undoer to make undoing easier. However, I also 
have some commands at a global level stored in myLeoSettings.leo that also 
call this undoer function. Since the code is specific to Leo, but sometimes 
shared across projects, where should I store the helper functions to keep 
it reusable across my outlines?

Thanks,
Sapphira Armageddos

-- 
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: LeoWapp will use WebSockets and Python 3

2018-10-29 Thread Edward K. Ream
On Mon, Oct 29, 2018 at 7:47 AM Terry Brown  wrote:

>
> https://github.com/flexxui/flexx
> provides websocket based Python browser GUI connections.
> John Lunzer pointed it out here:
> https://github.com/leo-editor/leo-editor/issues/338#issuecomment-289618411
>
> I've been using it in my recent (non-Leo) experiments in this area.
>

Thanks for these reminders.  I have not had any joy with various basic
WebSockets examples on Windows.  I'll soon test on Ubuntu.

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: LeoWapp will use WebSockets and Python 3

2018-10-29 Thread Terry Brown


https://github.com/flexxui/flexx
provides websocket based Python browser GUI connections.
John Lunzer pointed it out here:
https://github.com/leo-editor/leo-editor/issues/338#issuecomment-289618411

I've been using it in my recent (non-Leo) experiments in this area.

Cheers -Terry

On Mon, 29 Oct 2018 03:55:21 -0700 (PDT)
"Edward K. Ream"  wrote:

> Yesterday I started work in earnest on the leowapp.py plugin.  The
> gui work is complete for now: the web page contains the outline, body
> and log panes and the minibuffer.
> 
> Attempting two-way communication encountered a roadblock.  Putting 
> "require(http)" in a client-side script fails with the console
> message:
> 
> ReferenceError: require is not defined
> 
> We can not use a node.js server in the browser, as explained here 
> 
> .
> 
> With my new insights about sockets, I saw that the proper question is
> *not*:
> 
> Can javascript create *servers *in browsers?
> 
> but instead:
> 
> Can javascript create *sockets *in browsers?
> 
> The answer to this question is an emphatic yes 
> .
>  
> This leads to WebSockets ,
> with this tutorial
> .
> 
> *Summary*
> 
> WebSockets is perfect for LeoWapp: high performance, two-way
> communication, supported by all major browsers.  LeoWapp is essential
> if Leo's browser gui is to have the fine granularity I envisaged in
> the initial design.
> 
> web.py  or requests 
>  might replace the aging,
> ugly, python-side guts of leowapp.py. (The present code barfs on POST
> requests). We shall see. requests is part of the Anaconda distro,
> web.py is not.
> 
> Edward
> 
> P. S. Imo, LeoWapp should *require *Python 3. I see no justification 
> supporting Python 2 in leading-edge web work.  Comments in the 
> documentation for the requests package indicate that there are
> serious problems in attempting to do so.
> 
> 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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


LeoWapp will use WebSockets and Python 3

2018-10-29 Thread Edward K. Ream
Yesterday I started work in earnest on the leowapp.py plugin.  The gui work 
is complete for now: the web page contains the outline, body and log panes 
and the minibuffer.

Attempting two-way communication encountered a roadblock.  Putting 
"require(http)" in a client-side script fails with the console message:

ReferenceError: require is not defined

We can not use a node.js server in the browser, as explained here 

.

With my new insights about sockets, I saw that the proper question is *not*:

Can javascript create *servers *in browsers?

but instead:

Can javascript create *sockets *in browsers?

The answer to this question is an emphatic yes 
.
 
This leads to WebSockets , with 
this tutorial .

*Summary*

WebSockets is perfect for LeoWapp: high performance, two-way communication, 
supported by all major browsers.  LeoWapp is essential if Leo's browser gui 
is to have the fine granularity I envisaged in the initial design.

web.py  or requests 
 might replace the aging, ugly, 
python-side guts of leowapp.py. (The present code barfs on POST requests). 
We shall see. requests is part of the Anaconda distro, web.py is not.

Edward

P. S. Imo, LeoWapp should *require *Python 3. I see no justification 
supporting Python 2 in leading-edge web work.  Comments in the 
documentation for the requests package indicate that there are serious 
problems in attempting to do so.

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