On 6/8/2013 6:03 AM, Matt Wilkie wrote:
Hi Folks,
https://gist.github.com/maphew/5734699
An experimental Leo button which executes the currently selected node
as a python script after invoking User Account Control (UAC). Not
fully functional yet -- and dangerous. You could easily bork all your
data or even your computer with this: it runs code with admin
privileges, no sanity checking, and very limited feedback. Tracebacks
etc. are silently swallowed. The only feedback you'll get is what you
explicitly add, and only to gui widgets or files on disk at that, as
Windows hides the console window.
To use it:
1. Copy and paste the full text from the gist into any Leo outline pane
2. save and reopen the workbook to create the button
3. navigate to a node and push the [run-elevated] button, but for
heavens sake be careful!
I created this as part of my quest to enable easy integration with a
host Windows system from the nightly Leo archives and/or a portable
Leo distribution. It's intended application is to run the
'register-leo' and 'unregister-leo' scripts which (un)create the Leo
filetype associations.
It doesn't use Leo's native [Ctrl-B] run-node-as-script function,
which it probably should, but I don't know how to get at that yet. I
could use some help with it. Here's the part where it should go, I
think:
https://gist.github.com/maphew/5734699#file-run-elevated-xml-L37
You might want to use g.executeScript()... I *think* that's the function
backing run-script-as-node. I can't be certain, though. I have no idea
how to find out which command is backed by which function unless I've
added it. :P
http://leo-editor.readthedocs.org/en/latest/_modules/leo/core/leoCommands.html#Commands.executeScript
-->Jake
Feedback welcome,
-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 [email protected].
To post to this group, send email to [email protected].
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.