Outline to executable?

56 views
Skip to first unread message

Steve Litt

unread,
Sep 24, 2012, 7:03:39 PM9/24/12
to leo-e...@googlegroups.com
Hi all,

I'm not sure if I heard wrong, confabulated some memory or what, but
somewhere I got the impression that you could outline a computer
program in Leo, press a button, and get a Python app with a GUI
interface popping out. Is this true, or was I hallucinating?

If it's true, can you outline forms and picklists, and the interaction
between the two, and then press the button and have the app work? Can
you also outline database interactions.

Thanks

SteveT

Steve Litt * http://www.troubleshooters.com/
* http://twitter.com/stevelitt
Troubleshooting Training * Human Performance

Edward K. Ream

unread,
Sep 26, 2012, 8:42:48 AM9/26/12
to leo-e...@googlegroups.com
On Mon, Sep 24, 2012 at 6:03 PM, Steve Litt <sl...@troubleshooters.com> wrote:

> I'm not sure if I heard wrong, confabulated some memory or what, but
> somewhere I got the impression that you could outline a computer
> program in Leo, press a button, and get a Python app with a GUI
> interface popping out. Is this true, or was I hallucinating?

Interesting questions. Thanks for asking.

If by "press a button" you mean typing Ctrl-S, then Leo is an example
of such an app :-)

But I suppose you want to run a gui-based program from within Leo.
This is indeed possible, in several ways. Depending on your
situation, you may be able to share Leo's gui and event loop. You can
do this by creating Qt widgets in Leo.

For truly stand-alone apps, you would proceed similarly, but you would
run the app in a separate process. That way the event loops are
separate, and you could use perl or tcl/tk or ruby or whatever.

I'm being general and vague because I don't know exactly what you want to do.

> If it's true, can you outline forms and picklists, and the interaction
> between the two, and then press the button and have the app work? Can
> you also outline database interactions.

The general answer has got to be "yes" to all such questions, because
Leo outlines can store any data and can contain any scripts whatever.
I know this isn't necessarily a road map for any particular project.
Otoh, all of Leo's sources are in two .leo files, so I'm not speaking
hypothetically.

In short, you can do *anything* with Python and outlines. Whether it
will be easy is another matter. But Leo's DOM (scripting) makes the
association of programs and data with outlines straightforward, so
your ideas are perfectly reasonable.

HTH. Please feel free to ask more questions.

Edward

Steve Litt

unread,
Sep 26, 2012, 10:26:51 AM9/26/12
to leo-e...@googlegroups.com
On Wed, 26 Sep 2012 07:42:48 -0500, Edward K. Ream said:
> On Mon, Sep 24, 2012 at 6:03 PM, Steve Litt
> <sl...@troubleshooters.com> wrote:
>
> > I'm not sure if I heard wrong, confabulated some memory or what, but
> > somewhere I got the impression that you could outline a computer
> > program in Leo, press a button, and get a Python app with a GUI
> > interface popping out. Is this true, or was I hallucinating?
>
> Interesting questions. Thanks for asking.
>
> If by "press a button" you mean typing Ctrl-S, then Leo is an example
> of such an app :-)
>
> But I suppose you want to run a gui-based program from within Leo.

No. I want to *author* a program within Leo, including data entry
forms, and then press a button (type Ctrl+S), and have it generate the
executable I authored in Leo. Then other people just run the program
from the command line.

[clip]

Edward, I am sooooooo tired of all the hassle I need to go through to
build an app with a GUI user interface. Qt, Gtk, PythonTk, Java+Swing,
Rails, even Lazarus -- they're all such a clunky procedure for
something that *could* be so simple. An input screen is just a set of
specifications, but most of these tools make it into an event-driven
bowl of spaghetti.

What would be cool is to outline the input fields that should appear on
a screen -- what database table row and column they edit, what entry
and exit routines should be run on the input field, etc. Then press
Ctrl+S and I get a program. I don't care whether it's a python program,
or a binary executable, or something else. Just something.

> For truly stand-alone apps, you would proceed similarly, but you would
> run the app in a separate process. That way the event loops are
> separate, and you could use perl or tcl/tk or ruby or whatever.

I don't understand the preceding paragraph, but it sounds like this is
worth investigating. Is there any documentation on creating an app in
Leo?

Edward K. Ream

unread,
Sep 26, 2012, 11:14:15 AM9/26/12
to leo-e...@googlegroups.com
On Wed, Sep 26, 2012 at 9:26 AM, Steve Litt <sl...@troubleshooters.com> wrote:

> No. I want to *author* a program within Leo, including data entry
> forms, and then press a button (type Ctrl+S), and have it generate the
> executable I authored in Leo. Then other people just run the program
> from the command line.

No problem. Use @file to create an external file. Put your program
in that file. Run.

> What would be cool is to outline the input fields that should appear on
> a screen -- what database table row and column they edit, what entry
> and exit routines should be run on the input field, etc. Then press
> Ctrl+S and I get a program. I don't care whether it's a python program,
> or a binary executable, or something else. Just something.

My brother Speed may have already done something like what you want.
He wrote something called Leopard (Leo Python Response Daemon) that
turns Leo into a front end for, iirc, SQLite. The "screen" he edits is
simply a Leo outline.

Leo itself (that is a .leo file) may be the gui you want. Leo handles
the gui tedium. If you treat various parts of a custom Leo outline as
the input fields, and write scripts to handle those input fields *as a
db*, you will be following Speed's footsteps and getting all the gui
stuff "for free".

HTH.

Edward

Kent Tenney

unread,
Sep 26, 2012, 11:23:22 AM9/26/12
to leo-e...@googlegroups.com
I'm not sure if this is related, seems maybe.

I've longed for "specialized Leos": a config file which defines
- menus
- commands
- templates
- ...

which encapsulate the learning curve for an application.

Most apps consist of a set of files:
- source
- configuration
- data
- logs
- doc

I need to learn, or remember:
- where they are
- what they do
- how to troubleshoot
- how to test

All this before addressing the real issue: editing the _content_ of the files
to achieve a desired result.

A Leo 'instance' could be configured such that it understand the architecture,
is loaded with commands and buttons and menu items which understand the
relationships and offer explanations, allowing me to jump right to the
file contents,
or at least obviate a bunch of head scratching.

I'm currently trying to figure out Salt http://saltstack.org (which I
think is TheNextBigThing)
and, the figuring involves understanding the relationship between a
bunch of files:
a relationship which could be codified into a Leo customization which
offered a tree of
nodes having the relevant files loaded as @auto, a set of buttons
which ran scripts
using node contents, context sensitive help ...

One could imagine the same for Apache, LDAP, Pyramid, Samba ...

I've tried several times to implement this sort of thing, my Leo-Fu us
too weak, I
return to doing the actual work I need to do instead of building the
tool to make
the work easier.

Maybe this isn't related to your interests, if so, ... nevermind ...

Thanks,
Kent

On Wed, Sep 26, 2012 at 9:26 AM, Steve Litt <sl...@troubleshooters.com> wrote:
> --
> You received this message because you are subscribed to the Google Groups "leo-editor" group.
> To post to this group, send email to leo-e...@googlegroups.com.
> To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
>

felix74

unread,
Sep 26, 2012, 1:52:06 PM9/26/12
to leo-e...@googlegroups.com

No. I want to *author* a program within Leo, including data entry
forms, and then press a button (type Ctrl+S), and have it generate the
executable I authored in Leo. Then other people just run the program
from the command line.

If you just want a simple to use data entry form that you can bulid from leo outlines then you could try the following.

My favorite for more complicated forms as it is very versatile and has many widgets that you can put into you form.

I use it for small forms as you can get multiple inputs using a handful of lines of code. Increadibly easy to use.

Edward K. Ream

unread,
May 1, 2013, 12:33:00 PM5/1/13
to leo-editor
On Wed, Sep 26, 2012 at 9:26 AM, Steve Litt <sl...@troubleshooters.com> wrote:

Edward, I am sooooooo tired of all the hassle I need to go through to
build an app with a GUI user interface. Qt, Gtk, PythonTk, Java+Swing,
Rails, even Lazarus -- they're all such a clunky procedure for
something that *could* be so simple. An input screen is just a set of
specifications, but most of these tools make it into an event-driven
bowl of spaghetti.

Recent works has convinced me that the installation process is the first essential part of the Leo experience.  Kent has been saying that for years :-)

It's not true, however, that gui programs *could* be "so simple".  This is the plain, sad truth.  There is a huge amount going on behind the scenes that Leo mostly makes invisible. There is *no way*, imo, to drastically simply Leo's event handlers, for instance.

In short, simple installation is essential, but making installations simple will *not* be simple!

Edward
Reply all
Reply to author
Forward
0 new messages