Leo script to register .leo files with Windows

28 views
Skip to first unread message

Matt Wilkie

unread,
May 10, 2013, 5:03:46 AM5/10/13
to leo-e...@googlegroups.com
http://bazaar.launchpad.net/~maphew/leo-editor/pypi-packaging/view/head:/register-leo.leos

QQQQ
Tell Windows how to handle .leo files, enables double clicking on them to open.

To run: in Leo make this the active node and press [Ctrl-B] (execute-script)
       
Requires elevated User Account Control (UAC) privileges.
QQQQ

It is only lightly tested (one machine), but it seems to work. If successful, it takes over the need for the assoc and ftype commands and batch files which have been bobbing about lately (mostly be myself admittedly).

It's stored in an @file instead of .leo in order to make it easier to track in bazaar. Is there a naming convention for leo script files? I used .leos for "leo script", but it occurs to me that .leox might be better (leo executable) as it sidesteps the inadvertent pluralizing association.

feedback welcome,

-matt

Edward K. Ream

unread,
May 10, 2013, 7:34:04 AM5/10/13
to leo-editor
On Fri, May 10, 2013 at 4:03 AM, Matt Wilkie <map...@gmail.com> wrote:

It's stored in an @file instead of .leo in order to make it easier to track in bazaar.

which .leo file?

Edward

Matt Wilkie

unread,
May 10, 2013, 3:45:57 PM5/10/13
to leo-e...@googlegroups.com
A .leo file on my computer. It's not in bzr because every little change in re-organizing or open/collapsed nodes would trigger a "this file has changed and needs to committed" notification, and I have a lot of half baked and hare-brained ideas in there that no one else should be forced to wade through to get to the good stuff.

-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+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Matt Wilkie

unread,
May 16, 2013, 3:47:59 AM5/16/13
to leo-e...@googlegroups.com
I just pushed rev5785, which contains 2 leo scripts: register-leo and unregister-leo

register-leo.leox: Creates the necessary Windows registry keys for integration with Explorer and friends. After running this script .leo and .leox files are shown with the Leo icon, and 2x-clicking on them will open them in Leo.

This has the added benefit of removing the need for most to create a batch file and then figure out where in PATH to store it in order to use Leo. As a matter of fact, any .leo file becomes the equivalent of launchLeo.py, just try this:

   %homedrive%\homepath%\workbook.leo x:\path\to\some\other\leofile.leo


To install: open a command shell with administrative rights, and run:

    d:\path\to\python.exe d:\path\to\leo\launchLeo.py e:\path\to\register-leo.leox

...make "@file register-leo" the active node and press [Ctrl-B] (execute-script). You may need to log out and back in again for the icons to show up, but the double-click behaviour is effective immediately.

Eventually I'd like to see this activated from a Settings/Options/Preferences menu. Then we can distribute daily and portable builds of Leo and still have easy (dis)integration with the host (on Windows) and not rely so heavily on stable builds and installers, which are few and long between 'cause of the pain in building them.

feedback and testing welcome,

-matt

Matt Wilkie

unread,
May 16, 2013, 3:51:07 AM5/16/13
to leo-e...@googlegroups.com
I just pushed rev5785, which contains 2 leo scripts: register-leo and unregister-leo

Which brings the count of scripts I'm working on at the Leo root folder to 4. I'm not so comfortable with that, as it makes the first thing one sees busier than it should, and really these should be a fire-once and forget kind of thing. I'm not sure where in the Leo tree is the best place for them though. Suggestions?

-matt

Edward K. Ream

unread,
May 20, 2013, 3:18:54 PM5/20/13
to leo-editor
On Thu, May 16, 2013 at 2:51 AM, Matt Wilkie <map...@gmail.com> wrote:

I just pushed rev5785, which contains 2 leo scripts: register-leo and unregister-leo

Which brings the count of scripts I'm working on at the Leo root folder to 4. I'm not so comfortable with that, as it makes the first thing one sees busier than it should, and really these should be a fire-once and forget kind of thing. I'm not sure where in the Leo tree is the best place for them though. Suggestions?

Good question.  Here are my goals:

1.  Fix the bugs in the stand-alone (NSIS) installer.   See bug: https://bugs.launchpad.net/leo-editor/+bug/1021849  I plan to ask the NSIS people for help.  It's next on the list, and I'll get to it asap.

2. Remove the setup.py script from those distros for which it is unhelpful and confusing.

3. Have a single install.bat (or setup.bat) script that will do everything needed when *not* using the NSIS installer.  I have not looked at your scripts in details, but I regard them as useful intermediate steps.

Edward

Matt Wilkie

unread,
May 22, 2013, 2:59:48 PM5/22/13
to leo-e...@googlegroups.com
2. Remove the setup.py script from those distros for which it is unhelpful and confusing.

Is there a list of these distros?

3. Have a single install.bat (or setup.bat) script that will do everything needed when *not* using the NSIS installer.  I have not looked at your scripts in details, but I regard them as useful intermediate steps.
 
Agreed. The assumption/motivation for the scripts has been "how do I make an uninstalled Leo useful without installing?"

-matt


Edward K. Ream

unread,
May 22, 2013, 7:21:23 PM5/22/13
to leo-editor
On Wed, May 22, 2013 at 1:59 PM, Matt Wilkie <map...@gmail.com> wrote:

2. Remove the setup.py script from those distros for which it is unhelpful and confusing.

Is there a list of these distros?

Well, setup.py seems confusing on all platforms :-) Iirc, Ville wanted setup.py for some reason, but I don't remember why.

EKRy
Reply all
Reply to author
Forward
0 new messages