On Thu, 18 Nov 2010 23:12:26 -0800 (PST)
Ivanov Dmitriy <[email protected]> wrote:

> I decided to create a leo ftp plugin and need help. Please, someone
> experienced in leo programming, read my pdf with scheme and questions:
> 
> http://live-wtr.ru/ftp.pdf

So the goal is to make Leo log in to an ftp site and upload the derived files 
in the outline which have changed to that site?

Personally I use the linux command line tool `sitecopy` for this sort of thing.

But if you want to make Leo do it, there's a few considerations.

Does it need to be a plugin, or would a @button node be sufficient?  It would 
probably be simpler to get it working in a @button node first, anyway.

I don't know I'd store the config data in JSON, although I guess it wouldn't 
look so bad if you used the pretty print mode to save it back into the body 
text.

You probably want a c.save() in there somewhere to make sure the derived files 
on disk are current.

And of course you need to scan the outline to fine a list of all the derived 
files, that's probably not too hard, although off the top of my head I'm not 
sure what the best way to ID them without listing the directive names (file, 
auto, shadow, edit) yourself is.

So really the fiddly stuff is in the plugin / button creation part, which can 
be avoided with a @button node.  But there are plenty of plugins that do that 
sort of thing, which you could use as examples.  The nav_qt plugin (on by 
default) is one example, although maybe not the best one, as it adds icon 
buttons, not regular text buttons.

Also, onCreate's only called one on a commander, so you shouldn't need to worry 
about the button already being created.  I think following examples in other 
plugins will cover most of what you need.

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to