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-e...@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
- Generalize for other environments, sh on Linux, (zsh on Mac?)
- add a keyboard shortcut so you don't have to mouse.
-matt
> 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