Re: Leo on FreeBSD

2018-10-30 Thread Edward K. Ream
On Mon, Oct 29, 2018 at 4:17 PM Chris George  wrote:

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

Thanks for this report.  It's good to know all is well on another platform.

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-30 Thread Edward K. Ream
On Monday, October 29, 2018 at 11:11:17 AM UTC-5, Edward K. Ream wrote:

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

On Windows and Mozilla, the browser-based example 
 
does work,  provided that I temporarily disabled noscript's security checks 
for file:/// urls .  Without this 
exception, noscript munges the page and the Mozilla debugger console shows:

Content Security Policy: The page’s settings blocked the loading of a 
resource at inline (“script-src”).

When I close the web page, the demo server throws this exception, but 
continues serving:

Traceback (most recent call last):
  File "c:\Anaconda3\lib\site-packages\websockets\server.py", line 152, in 
handler
yield from self.ws_handler(self, path)
  File "websockets_demo_server.py", line 15, in time
await websocket.send(now)
  File "c:\Anaconda3\lib\site-packages\websockets\protocol.py", line 361, in 
send
yield from self.ensure_open()
  File "c:\Anaconda3\lib\site-packages\websockets\protocol.py", line 501, in 
ensure_open
self.close_code, self.close_reason) from self.transfer_data_exc
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: 
code = 1001 (going away), no reason

This is a bit off-putting, but apparently all is working as it should.

Catching ConnectionClosed changes the noise, but might not be the proper 
solution.

*Summary*

It's troubling to disable security checks, even temporarily. I'm a bit 
surprised that such matters weren't mentioned in the websockets 
documentation .

I'll contact the author to ask his advice on various matters.

The next step will be to fold the relevant code into leowapp.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: LeoWapp will use WebSockets and Python 3

2018-10-30 Thread Edward K. Ream
On Tuesday, October 30, 2018 at 5:54:39 AM UTC-5, Edward K. Ream wrote:

It's troubling to disable security checks, even temporarily. I'm a bit 
> surprised that such matters weren't mentioned in the websockets 
> documentation .
>

The left-hand panel contains links to the full documentation, including 
security.  It's time to study...

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-30 Thread Terry Brown
On Tue, 30 Oct 2018 08:51:18 -0700 (PDT)
"Edward K. Ream"  wrote:

> On Tuesday, October 30, 2018 at 5:54:39 AM UTC-5, Edward K. Ream
> wrote:
> 
> It's troubling to disable security checks, even temporarily. I'm a
> bit 
> > surprised that such matters weren't mentioned in the websockets 
> > documentation
> > .
> 
> The left-hand panel contains links to the full documentation,
> including security.  It's time to study...

I do wonder if it's necessary to include development of a websockets
layer in LeoWapp.  Maintenance burden, complexity, all that.

Flexx is a Python framework that uses websockets, there are probably
others.

Also there a lots of web app. frameworks (Flask, Django, etc.) which
don't use websockets by default (they use regular AJAX), but can.

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

2018-10-30 Thread Edward K. Ream
On Tue, Oct 30, 2018 at 11:07 AM Terry Brown  wrote:

I do wonder if it's necessary to include development of a websockets
> layer in LeoWapp.  Maintenance burden, complexity, all that.
>
> Flexx is a Python framework that uses websockets, there are probably
> others.
>
> Also there a lots of web app. frameworks (Flask, Django, etc.) which
> don't use websockets by default (they use regular AJAX), but can.
>

That welcome news. I agree we should use the highest level tools available.

I'll study Flexx, Flask and Django next.  I had no idea they could use
websockets.

What framework do you prefer?

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-30 Thread Offray Vladimir Luna Cárdenas

On 10/30/18 11:50 AM, Edward K. Ream wrote:
> On Tue, Oct 30, 2018 at 11:07 AM Terry Brown  > wrote:
>
> I do wonder if it's necessary to include development of a websockets
> layer in LeoWapp.  Maintenance burden, complexity, all that.
>
> Flexx is a Python framework that uses websockets, there are probably
> others.
>
> Also there a lots of web app. frameworks (Flask, Django, etc.) which
> don't use websockets by default (they use regular AJAX), but can.
>
>
> That welcome news. I agree we should use the highest level tools
> available.
>
> I'll study Flexx, Flask and Django next.  I had no idea they could use
> websockets.
>
> What framework do you prefer?
>
>From my Python times, I liked a lot web2py[1] as a full stack python
based but easy and self-contained web framework. Bottle and Flask would
be my alternatives for minimal web frameworks.

[1] http://web2py.com/

Cheers,

Offray

-- 
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-30 Thread Terry Brown
On Tue, 30 Oct 2018 11:50:12 -0500
"Edward K. Ream"  wrote:

> On Tue, Oct 30, 2018 at 11:07 AM Terry Brown 
> wrote:
> 
> I do wonder if it's necessary to include development of a websockets
> > layer in LeoWapp.  Maintenance burden, complexity, all that.
> >
> > Flexx is a Python framework that uses websockets, there are probably
> > others.
> >
> > Also there a lots of web app. frameworks (Flask, Django, etc.) which
> > don't use websockets by default (they use regular AJAX), but can.
> 
> That welcome news. I agree we should use the highest level tools
> available.
> 
> I'll study Flexx, Flask and Django next.  I had no idea they could use
> websockets.
> 
> What framework do you prefer?

They're all very different.  I've used Django quite a bit in the past,
and would again for large web based applications.  It handles user
logins, rights management, templates, database binding and updating,
form generation, etc. etc.  Probably not the right weight for LeoWapp.
I don't know what it's like for web-sockets, "Django Channels" use
web-sockets, that's all I know.

Haven't used Flask, just fiddled with tutorial.  No idea if its
websocket support is very mature / well integrated.

Am playing with Flexx experimenting with visualizing multiple graphs,
thought I'd mentioned that although not seeing the post now.

Flexx uses web-sockets by default / exclusively, so it's probably going
to be the most solid there.

Flexx's approach is idiosyncratic enough that you're probably stuck
with it if you use it (it translates Python to Javascript :-) but there
might be options which let you separate the transport layer.  Certainly
this would be the case if you were using regular AJAX, I'm less
familiar with options for websockets.

I'm thinking the decision that LeoWapp will use websockets is fine, but
you won't always see the performance benefits of websockets over AJAX.
On a local machine AJAX should be fast enough, seeing the "network" is
basically in memory, and over remote links I suspect (not sure) that
you'll need good low latency connectivity or the network will be the
bottleneck, not the transport protocol.  Don't want to dissuade you
from websockets, just that AJAX is more common and therefore easier for
Google to answer random questions etc. etc.

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

2018-10-30 Thread Edward K. Ream
On Tue, Oct 30, 2018 at 12:11 PM Offray Vladimir Luna Cárdenas wrote:

> From my Python times, I liked a lot web2py[1] as a full stack python based
> but easy and self-contained web framework. Bottle and Flask would be my
> alternatives for minimal web frameworks.
>
> [1] http://web2py.com/
>
Thanks for this.  I'll add web2py and Bottle to the list.

I've gotten the first few Flexx examples working.  The widgets look ugly,
but perhaps that will not be an issue in the long run...

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-30 Thread Edward K. Ream
On Tue, Oct 30, 2018 at 12:14 PM Terry Brown wrote:

> What framework do you prefer?
>
...

> Flexx uses web-sockets by default / exclusively, so it's probably going
> to be the most solid there.
>

That seems important.

Flexx's approach is idiosyncratic enough that you're probably stuck
> with it if you use it (it translates Python to Javascript :-) but there
> might be options which let you separate the transport layer.  Certainly
> this would be the case if you were using regular AJAX, I'm less
> familiar with options for websockets.
>

Not sure what to think about this.

I'm thinking the decision that LeoWapp will use websockets is fine, but
> you won't always see the performance benefits of websockets over AJAX.
>

Performance is a secondary consideration. Imo, websockets is the only thing
that could possibly work in a natural manner.

Before I knew of websockets I considered several alternatives using ajax.
All of them seem like Rube Goldberg machines.  I say this because Leo is
definitely not your typical web app.  If we are to bring *full* Leo to the
browser, then we have to allow Ctrl-b and @button scripts.  That is, we
must have true, two-way, communication between Leo's core and the browser,
with browser gui code standing in the middle.

Leo's scripts (and Leo's core) know nothing about which gui is in effect,
but they may well do things that affect the gui.  Without websockets we
will probably have to kludge up some kind of standard interaction between
scripts, Leo and the browser.  With websockets we can just let interactions
happen when they happen.

I'm not being overly clear here, but I think the Leo's gui layer would be
straightforward with web sockets and difficult or impossible without.

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-30 Thread Terry Brown
On Tue, 30 Oct 2018 12:16:34 -0500
"Edward K. Ream"  wrote:

> I've gotten the first few Flexx examples working.  The widgets look
> ugly, but perhaps that will not be an issue in the long run...

I'm not sure how that will play out, for example can you integrate
Flexx with other layers like Bootstrap?

It can embed editors like Ace:
https://flexx.readthedocs.io/en/stable/examples/editor_ace_src.html#editor-ace-py

and use frameworks like d3:
https://flexx.readthedocs.io/en/stable/examples/d3_collision_src.html#d3-collision-py

Flexx's tree is fairly basic, no keyboard nav. etc., if I were
attempting what you're attempting I'd look at using
http://www.inspire-tree.com/ from Flexx - Offray pointed out Inspire Tree 
recently.

I'm not saying that's an easy way to go, but it might give you a head
start vs. adding features to Flexx's tree.

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.