Re: python_terminal.py

2018-11-04 Thread Edward K. Ream
On Fri, Nov 2, 2018 at 5:21 PM Chris George  wrote:

The solution was to disable [python_terminal.py].
>

Thanks for this report. I've just created #1009
 for this issue.

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 progress report

2018-11-04 Thread Edward K. Ream
On Sat, Nov 3, 2018 at 3:21 PM Terry Brown wrote:

Flexx is very different from other frame works because you write everything
> in Python. You might try writing a web gui in Vue, React, or JQuery to get
> something more typical.
>

Thanks for this.  I am becoming convinced that flexx is exactly what Leo
needs. This response will be pre-writing for the info item #1011
: About Leo and flexx.

Btw, I agree that LeoWapp will be a major project.  It may turn out to be
more work than the console gui project because:

- LeoWapp is so much more important than the console gui.
- flexx (or whatever) is so much more capable than npyscreen.
- There are hosting issues that do not arise when using the console gui.

I spent yesterday skimming through the flexx manuals and trying example
code, including various ways of launching prototypes.  Everything I see
suggests that flexx is *exactly* the right tool for Leo's browser gui:

1. Flexx is almost completely symmetric with regard to both communication
and classes.

Imo, this symmetry is essential, and flexx achieves this symmetry far more
thoroughly than I would have thought possible.  flexx uses virtually
identical proxies on both ends.  As a result, the corresponding python and
js classes are almost identical.  You can see this in the Sensible Usage
Patterns  page
of the flexx docs.  Hardly any changes are required to "lean" towards js or
python.  This is remarkable. Aside: I'm not sure which way Leo's flexx gui
will lean.

2. Flexx solves the circular events problem elegantly.

Leo's Qt gui must have lockouts so that Qt events don't spawn endless
chains of events. In contrast, flexx solves this problem elegantly.  See
the diagram in the middle of the Events System
 page.
Immediately below this diagram is the following:

QQQ
One might argue that the information flow is still circular, because there
is an arrow going from reactions to actions. This is true, but note that
actions invoked from reactions are not directly executed; they are pended
and will be executed only after all reactions are done.
QQQ

3. PScript
is
exactly what I want.

The translation of a python-like dialect to javascript cuts the Gordian
Knot of lack of support for python in browser.  PScript is a separate
project, which appears to be under active development.  It is already miles
ahead of my fondest dreams.

Yes, there is a learning curve, but it's not difficult.  For example, it
took me awhile to see why %10s doesn't justify text inside an event
handler, where ev is a flexx event:

id_ = ev.source.title or ev.source.text
text = '%10s: %s' % (id_, kind + ev.type)

The answer: text is a JS (flexx javascript string), not a python string.

One could worry that somehow PScript won't be as flexible as javascript,
but that seems unlikely.  We only care about the combination of PScript and
flexx's Widgets, and it's hard to imagine that PScript can't service
flexx's needs adequately.

4. Creating and laying out flexx widgets is so much simpler than with Qt or
npyscreen.

Look at the flexx demos
.  Using
nested "with" statements to lay out pages is clever.

5. There are many ways to launch flexx prototypes.

The Ways to run a Flexx app
 page covers the
basics.  I like to fire up the browser during development.  This can be
done with the --flexx-webruntime=browser option.  See the configuration page
.

I use this flexx.bat file to run the leo/plugins/leoflexx.py prototype.
(not pushed yet):

python leo\plugins\leoflexx.py --flexx-webruntime=browser

Within leoflexx.py, the following code appears:

if __name__ == '__main__':
# Use `--flexx-webruntime=browser` to run in browser.
flx.launch(TreeExample)
flx.run()

6. Flexx has a great in-browser debugger.

When run from flexx, F12 brings up a flexx-oriented debugger.  This is not
the same as Mozilla's debugger, which can be brought up with Shift-Ctrl-C.
I have little experience debugging js, but there is no doubt that either
debugger is a lot more capable than the print statements I had to use when
debugging the console gui.

7. Flexx provides essential wrappers for Tornado.

I have not studied the Tornado docs 
at all, so this is a provisional conclusion.  However, it seems unlikely
that flexx would exist if using Tornado were as easy as using flexx.  Oh, I
suppose one can image a situation in which using "raw" Tornado would give
some extra flexibility, but for now flexx seems to give exactly the
services that LeoWapp needs.

Furthermore, flexx's source code is small and elegant.  Th

Re: Might be interesting for Leo WebApp

2018-11-04 Thread Edward K. Ream
On Sat, Nov 3, 2018 at 11:28 PM Matt Wilkie  wrote:

> Enhancement request done!
> https://github.com/leo-editor/leo-editor/issues/1010
>

Thanks, Matt.

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.


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

2018-11-04 Thread Arjan
Hello all,

I asked this question in the Anaconda forums but didn't get any response 
there. I'm hoping some of you have an answer to this question.

With a previous installation, with Anaconda's Python on my PATH in Windows, 
I used to just create a shortcut for Leo with a target like this:

C:\Programs\Anaconda3\pythonw.exe "C:\Programs\Leo-editor\launchLeo.py"

On a new install I now went with the default and recommended option to not 
put Anaconda on the PATH. I tried making a .bat file which runs both 
Anaconda3\Scripts\activate.bat and pythonw.exe, but activate.bat leaves 
behind a console window I don't want. There's tons of questions and 
potential solutions about similar issues on Windows in general, but they 
don't seem applicable for this particular case, or they involve 3rd party 
programs or vbs scripts to manage it.

Is there a good way to do what I want - to launch Leo from a shortcut 
(which requires an Anaconda environment) without getting an extra console 
window?

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


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

2018-11-04 Thread Zoom.Quiet
for in win10, i know some ways to make hide terminal windows:

0: CMDOW /RUN /HID python ...
1: as system -> Task Scheduler
2: as reboot auto run
3: ...

but not test for Leo
Arjan  于2018年11月4日周日 下午7:24写道:
>
> Hello all,
>
> I asked this question in the Anaconda forums but didn't get any response 
> there. I'm hoping some of you have an answer to this question.
>
> With a previous installation, with Anaconda's Python on my PATH in Windows, I 
> used to just create a shortcut for Leo with a target like this:
>
> C:\Programs\Anaconda3\pythonw.exe "C:\Programs\Leo-editor\launchLeo.py"
>
> On a new install I now went with the default and recommended option to not 
> put Anaconda on the PATH. I tried making a .bat file which runs both 
> Anaconda3\Scripts\activate.bat and pythonw.exe, but activate.bat leaves 
> behind a console window I don't want. There's tons of questions and potential 
> solutions about similar issues on Windows in general, but they don't seem 
> applicable for this particular case, or they involve 3rd party programs or 
> vbs scripts to manage it.
>
> Is there a good way to do what I want - to launch Leo from a shortcut (which 
> requires an Anaconda environment) without getting an extra console window?
>
> Cheers,
> 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.



-- 
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

-- 
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 progress report

2018-11-04 Thread Edward K. Ream
On Sunday, November 4, 2018 at 4:48:18 AM UTC-6, Edward K. Ream wrote:

> This response will be pre-writing for the info item #1011 
: About Leo and flexx.

I have now completed the first draft of #1011.  It contains only minor 
edits.

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.


Wow: take a look at leoflexx.py

2018-11-04 Thread Edward K. Ream
Cutting and pasting this demo 

 
created a functional ace-based editor in Leo's body pane.

Run the code as follows:

python leo\plugins\leoflexx.py --flexx-webruntime=
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: How to launch Leo via pythonw.exe with an Anaconda environment but without an extra console window?

2018-11-04 Thread Matt Wilkie
For leo specifically, install leo with pip and then create a shortcut to 
`PYTHONHOME\Scripts\leo.exe`. Something like:

End user:

conda create -n Leo
activate Leo
conda install pip
pip install leo
mklink "%HOMEDRIVE%%HOMEPATH%\Desktop\Leo.lnk" ^
  C:\Programs\Anaconda3\envs\Leo\scripts\leo.exe
mklink "%HOMEDRIVE%%HOMEPATH%\Desktop\Leo with cmd.lnk" ^
  C:\Programs\Anaconda3\envs\Leo\scripts\leo-messages.exe



Developer:

conda create -n Leo
activate Leo
conda install pip
git clone https://github.com/leo-editor/leo-editor.git
pushd leo-editor
git checkout devel
pip install --editable .
mklink "%HOMEDRIVE%%HOMEPATH%\Desktop\Leo.lnk" ^
  C:\Programs\Anaconda3\envs\Leo\scripts\leo.exe
mklink "%HOMEDRIVE%%HOMEPATH%\Desktop\Leo with cmd.lnk" ^
  C:\Programs\Anaconda3\envs\Leo\scripts\leo-messages.exe




`pip install ...` reading from `setup.py` creates the wrapper scripts in a 
platform dependent way, choosing pythonw for windows for a console-less 
gui. To adapt for another program see "using `entry_points` for scripts" - 
https://packaging.python.org/specifications/entry-points/#use-for-scripts. 
(This is probably a better introduction, though it doesn't discuss gui 
scripts: 
https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html)

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.


cool things: python-fire

2018-11-04 Thread Matt Wilkie
Drop this in the "cool things seen out there" and "probably room for this 
in my toolkit" bins:

*Python-fire  -* 
*a library for automatically generating command line interfaces (CLIs) from 
absolutely any Python object. *


*...call Fire in your library, then you can run all of it's functionality 
from the command line without having to keep making changes to a main 
method. *

*...**take an existing module, maybe even one that you don't have access to 
the source code for, and call Fire on it. This lets you easily see what 
functionality this code exposes, without you having to read through all the 
code.*

-- 
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: Wow: take a look at leoflexx.py

2018-11-04 Thread Matt Wilkie
*I??!!! Wow indeed*

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