[jp] Plugin for executing scripts
judd at jpilot.org
Sun Jun 1 19:47:46 EDT 2003
Ludovic Rousseau wrote:
> Le dimanche 01 juin 2003 à 20:05:15, Nicholas Piper a écrit:
>>You could put things in the plugin_setup() (or however it is named, I
>>forget.) That would run when jpilot starts, maybe that is too early
>>for you though.
> Yes, a bit too early :-). I do not restart jpilot except when I reboot
> the computer.
>>If you use jpilot-sync to do your syncing (rather than the button in
>>jpilot's GUI) it might be better suited, as it would run when
>>jpilot-sync is first started.
> Maybe. But I only use the Sync button and don't really want to start a
> command line.
> If plugin_pre_sync() is called before the Palm is connected we will also
> solve the problem of batterie usage: power on the Palm _only_ when
> J-Pilot is ready to sync.
> The patch I propose is simple: just move the "pre_sync plugin" piece of
> code at the start of jp_sync() in sync.c.
> My question is: will it break existing plugins?
I don't know if it will break any plugins. I don't think so.
I guess a good name for a new function would be
pi_watchdog() can be used for things that take a long time to prevent
the sync from timing out.
My reasoning IIRC, for pre_sync being there is because I wanted to make
sure that the connection to the palm actually happened before any work
A side note: When I wrote the sync code, threads were not standard on
Linux or many unix's. I use an ugly fork. I think I am going to
rewrite this using threads like I wanted to in the first place.
More information about the Jpilot