Re: open Command Prompt here

2010-05-29 Thread Terry Brown
On Thu, 27 May 2010 15:20:36 -0700
Matt Wilkie map...@gmail.com wrote:

 d = c.scanAllDirectives(p)
 # g.es(g.dictToString(d))   #uncomment to show results of above in log pane
 
 path = d.get('path')

I think you can use 'path = c.getNodePath(p)' here, although I see 
active_path.py is doing something similar to what you do, one of those don't 
touch it if it works things.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



open Command Prompt here

2010-05-27 Thread Matt Wilkie
Hello world,

Here is handy little button for windows users. Create node with the
headline @button CMD here, save and reopen Leo.

QQQ
@
Open a windows cmd.exe prompt in the path of the currently selected node.
A mapped drive letter will be created for a UNC path.

Adapted from:

http://webpages.charter.net/edreamleo/scripting.html#working-with-directives-and-paths
http://www.mail-archive.com/leo-editor@googlegroups.com/msg12177.html
@c

d = c.scanAllDirectives(p)
# g.es(g.dictToString(d))   #uncomment to show results of above in log pane

path = d.get('path')
name = p.anyAtFileNodeName()
if name:
   name = g.os_path_finalize_join(path,name)
   g.es(name)

from subprocess import Popen
Popen(r'cmd.exe /k pushd %s' % path)

QQQ

enjoy :)

-matt

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: open Command Prompt here

2010-05-27 Thread Matt Wilkie
Ideas for improvement:

- Generalize for other environments, sh on Linux, (zsh on Mac?)
- add a keyboard shortcut so you don't have to mouse.

-matt

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.