LeoWapp: Leo in a browser?

208 views
Skip to first unread message

Viktor Ransmayr

unread,
Apr 27, 2019, 1:38:06 PM4/27/19
to leo-editor
Hello Edward,

LeoWapp is announced as one of the main new features for Leo 5.9.

Where can I find a description how to use it?

In my case the current defaults would be Windows 10 as the OS and Firefox as the Web Browser.

With kind regards,

Viktor

Edward K. Ream

unread,
Apr 27, 2019, 1:49:26 PM4/27/19
to leo-editor
On Sat, Apr 27, 2019 at 12:38 PM Viktor Ransmayr <viktor....@gmail.com> wrote:
Hello Edward,

LeoWapp is announced as one of the main new features for Leo 5.9.

Where can I find a description how to use it?

leo --no-splash --no-plugins --gui=browser:firefox-browser <path to your .leo file>

The actual code is in leo/plugins/leoflexx.py.  At present, the docstring contains:

QQQ
flexx.py: LeoWapp (Leo as a web browser), implemented using flexx:
https://flexx.readthedocs.io/en/stable/

This file is the main line of the LeoWapp project.
https://github.com/leo-editor/leo-editor/issues/1005.

See #1005 for a status report and list of to-do's.

# Prerequisites

Install flexx: https://flexx.readthedocs.io/en/stable/start.html

# Running stand-alone

You can run leoflexx.py in stand-alone mode from a console:

    python <path to>leoflexx.py --flexx-webruntime=firefox-browser

The --flex-webruntime command-line arg is optional. If omitted, you'll use
the webruntime environment.

When running stand-alone, the startup code uses Leo's bridge module to load
unitTest.leo.

# Running as Leo's gui

You can also run leoflexx.py as Leo's gui:

    leo --gui=browser
    leo --gui=browser-firefox-browser
   
# What you should see
   
However you start leoflexx.py you should see the flexx (Tornado) server
start up in the console.

Something that looks like Leo should then appear in the browser. Everything
you see is real, and most of it is "live".
QQQ

HTH.

Edward

Viktor Ransmayr

unread,
Apr 27, 2019, 3:38:39 PM4/27/19
to leo-e...@googlegroups.com
Hello Edward,

Thanks a lot for your quick response!

Am Sa., 27. Apr. 2019 um 19:49 Uhr schrieb Edward K. Ream <edre...@gmail.com>:
On Sat, Apr 27, 2019 at 12:38 PM Viktor Ransmayr <viktor....@gmail.com> wrote:
Hello Edward,

LeoWapp is announced as one of the main new features for Leo 5.9.

Where can I find a description how to use it?

leo --no-splash --no-plugins --gui=browser:firefox-browser <path to your .leo file>

The actual code is in leo/plugins/leoflexx.py.  At present, the docstring contains:

QQQ
flexx.py: LeoWapp (Leo as a web browser), implemented using flexx:
https://flexx.readthedocs.io/en/stable/

This file is the main line of the LeoWapp project.
https://github.com/leo-editor/leo-editor/issues/1005.

See #1005 for a status report and list of to-do's.

# Prerequisites

Install flexx: https://flexx.readthedocs.io/en/stable/start.html

Confirmed !


# Running stand-alone

You can run leoflexx.py in stand-alone mode from a console:

    python <path to>leoflexx.py --flexx-webruntime=firefox-browser

The --flex-webruntime command-line arg is optional. If omitted, you'll use
the webruntime environment.

I receive the following error, when I attempt to execute

* python C:/Users/Viktor/pyve/VE4leo/lib/site-packages/leo/plugins/leoflexx.py

<Log>

(VE4Leo) PS C:\Users\Viktor\pyve\VE4leo> python C:/Users/Viktor/pyve/VE4leo/lib/site-packages/leo/plugins/leoflexx.py
[I 21:22:28 flexx.app] Asset store collected 2 new modules.
Traceback (most recent call last):
  File "C:/Users/Viktor/pyve/VE4leo/lib/site-packages/leo/plugins/leoflexx.py", line 2245, in <module>
    flx.launch(LeoBrowserApp)
  File "C:\Users\Viktor\PyVE\VE4Leo\lib\site-packages\flexx\app\_funcs.py", line 229, in launch
    return a.launch(runtime, **runtime_kwargs)
  File "C:\Users\Viktor\PyVE\VE4Leo\lib\site-packages\flexx\app\_app.py", line 151, in launch
    current_server()
  File "C:\Users\Viktor\PyVE\VE4Leo\lib\site-packages\flexx\app\_server.py", line 78, in current_server
    create_server()
  File "C:\Users\Viktor\PyVE\VE4Leo\lib\site-packages\flexx\app\_server.py", line 59, in create_server
    _current_server = TornadoServer(host, port, loop, **server_kwargs)
  File "C:\Users\Viktor\PyVE\VE4Leo\lib\site-packages\flexx\app\_tornadoserver.py", line 56, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Users\Viktor\PyVE\VE4Leo\lib\site-packages\flexx\app\_server.py", line 118, in __init__
    self._open(host, port, **kwargs)
  File "C:\Users\Viktor\PyVE\VE4Leo\lib\site-packages\flexx\app\_tornadoserver.py", line 70, in _open
    IOLoop._current.instance = None
AttributeError: type object 'IOLoop' has no attribute '_current'
(VE4Leo) PS C:\Users\Viktor\pyve\VE4leo>


</Log>

What did I do wrong - or - what additional information do you need to put me on track?

With kind regards,

Viktor

PS: Please note that this is an environment that I've installed using pip & PyPI ...

PPS: Here's the initial information displayed in the log-pane, if I start Leo directly ...

Leo Log Window
Leo 5.9-b2, build 20190409061733, Tue Apr  9 06:17:32 UTC 2019
Not running from a git repo
Python 3.6.5, PyQt version 5.11.2
Windows 10 AMD64 (build 10.0.17763) SP0
isPython3: True
current dir: C:/Users/Viktor/pyve/VE4leo
load dir: C:/users/viktor/pyve/ve4leo/lib/site-packages/leo/core
global config dir: C:/users/viktor/pyve/ve4leo/lib/site-packages/leo/config
home dir: C:/Users/Viktor
reading settings in C:/users/viktor/pyve/ve4leo/lib/site-packages/leo/config/leoSettings.leo
reading settings in C:/Users/Viktor/.leo/myLeoSettings.leo
reading settings in C:/Users/Viktor/.leo/workbook.leo
may be open in another Leo:
C:/Users/Viktor/.leo/workbook.leo
read outline in 0.06 seconds
reading settings in C:/users/viktor/pyve/ve4leo/lib/site-packages/leo/doc/LeoDocs.leo


Edward K. Ream

unread,
Apr 27, 2019, 6:22:59 PM4/27/19
to leo-editor
On Sat, Apr 27, 2019 at 2:38 PM Viktor Ransmayr wrote:

> Thanks a lot for your quick response!

You're welcome.  Your question reminded me that the documentation for LeoWapp was not easy to find.  And it was obsolete.  Recent revs bring the docs up to date.

> I receive the following error, when I attempt to execute

  python ...leo/plugins/leoflexx.py

This stand-alone operation was for testing only.  Please try one of these:

   leo --gui=browser
   leo --gui=browser-firefox-browser

Here are the updated docs in LeoDocs.leo:

QQQ


LeoWapp (Leo as a web browser), implemented using flexx:
https://flexx.readthedocs.io/en/stable/

Start Leo using the --gui=browser option. Like this::

    leo --gui=browser
    leo --gui=browser-firefox-browser

The code is in leo/plugins/leoflexx.py, but this is not a plugin.
What you should see
   
You should see the flexx (Tornado) server start up in the console. Something that looks like Leo should then appear in the browser. Everything you see is real, and most of it is "live".
QQQ

HTH. Please feel free to ask more questions.

Edward

Edward K. Ream

unread,
Apr 28, 2019, 3:04:36 AM4/28/19
to leo-editor
On Saturday, April 27, 2019 at 2:38:39 PM UTC-5, Viktor Ransmayr wrote:

I receive the following error, when I attempt to execute

* python .../leo/plugins/leoflexx.py

This is flexx issue #555.  The fix, presumably, is to upgrade to the latest version of flexx.

Edward

Viktor Ransmayr

unread,
Apr 28, 2019, 4:00:51 AM4/28/19
to leo-e...@googlegroups.com
Hello Edward,

Yes, I can confirm, that this was the problem.

I was initially using flexx in version 0.7.1.

After upgrading flexx to version 0.8.0 I tried out "leo --gui=browser-firefox-browser" and


displays the 'workbook.leo' outline in a new FF-Tab ...

Thanks a lot again for your support !

With kind regards,

Viktor

Edward K. Ream

unread,
Apr 28, 2019, 4:03:45 AM4/28/19
to leo-editor
On Sun, Apr 28, 2019 at 3:00 AM Viktor Ransmayr wrote:

After upgrading flexx to version 0.8.0 I tried out "leo --gui=browser-firefox-browser" and

displays the 'workbook.leo' outline in a new FF-Tab ...

Thanks a lot again for your support !

You're welcome. I'm glad the upgrade worked.

Edward

Viktor Ransmayr

unread,
Apr 28, 2019, 4:10:28 PM4/28/19
to leo-e...@googlegroups.com
Hello Edward,
I've now found some time to 'play' with LeoWapp a bit - and - are now quite surprised that I'm not able to enter any command in the minibuffer :-(

Is this supposed to work - or - is this a current limitation of LeoWapp in 5.9b2?

With kind regards,

Viktor

PS: I experience the same behaviour when using Google Chrome - as well as - Mozilla Firefox as the web browser in a Windows 10 (1809) environment ...

Edward K. Ream

unread,
Apr 29, 2019, 7:30:20 AM4/29/19
to leo-editor
On Sun, Apr 28, 2019 at 3:10 PM Viktor Ransmayr  wrote:

> I've now found some time to 'play' with LeoWapp a bit - and - are now quite surprised that I'm not able to enter any command in the minibuffer :-(

I've just created #1131 for this.  There used to be some hacks relating to minibuffer commands.  I'm not sure what is supposed to happen.

Edward

Viktor Ransmayr

unread,
Apr 29, 2019, 2:43:23 PM4/29/19
to leo-e...@googlegroups.com
Hello Edward,

Please let me know, if there's something I can do/ test ...

With kind regards,

Viktor

Viktor Ransmayr

unread,
May 7, 2019, 4:42:28 PM5/7/19
to leo-e...@googlegroups.com
Hello Edward,

I tried the "devel" branch of Leo from GitHub - and - installed it successfully via "pip install https://github.com/leo-editor/leo-editor/archive/devel.zip".

I can now enter commands in the minibuffer - but - all/ most of them don't work ...

Where are the current limitations of LeoWapp documented?

With kind regards,

Viktor

Edward K. Ream

unread,
May 8, 2019, 7:15:32 AM5/8/19
to leo-editor
On Tue, May 7, 2019 at 3:42 PM Viktor Ransmayr <viktor....@gmail.com> wrote:

> Where are the current limitations of LeoWapp documented?

In info and bug issues: here.

Let me know if you would like more documentation on a particular topic.

Edward

lewis

unread,
May 16, 2019, 9:37:50 AM5/16/19
to leo-editor
Clones are working in LeoWapp but there appears to be no visible indication that a node is cloned. Is there any plan to show a small red clone arrow in the icon box? 

find-next-clone command works, and using Alt-n key press works for 'Go to next clone'

Regards
Lewis

Edward K. Ream

unread,
May 16, 2019, 10:28:46 AM5/16/19
to leo-editor
On Thu, May 16, 2019 at 8:37 AM lewis <lewi...@operamail.com> wrote:
Clones are working in LeoWapp but there appears to be no visible indication that a node is cloned. Is there any plan to show a small red clone arrow in the icon box? 

I've just added this to the to-do list in #1005, but it may never happen.  For now, I'm interested in real bugs.  Note that #1005 is closed.

Edward

lewis

unread,
Oct 15, 2020, 10:52:44 PM10/15/20
to leo-editor
The new command  restart-leo   works when running LeoWapp.

Regards
Lewis

Edward K. Ream

unread,
Oct 16, 2020, 8:04:48 AM10/16/20
to leo-editor
On Thu, Oct 15, 2020 at 9:52 PM lewis <lewi...@operamail.com> wrote:
The new command  restart-leo   works when running LeoWapp.

Cool! Thanks for verifying this.

Edward
Reply all
Reply to author
Forward
0 new messages