← Back to team overview

zim-wiki team mailing list archive

Re: Startup- and shutdown-code


Hello Jaap,

I always forget to mention that I'm using Windows 7 Professional, 64 Bit SP1, sorry!

So to make it concrete, if I understand correctly:
1/ at startup: set environment parameters for locale settings
2/ at shutdown: trigger backup copy commands

For 1/ I would suggest either setting them permanently in your environment (are you on linux,
windows, ... ?) so you don't have to do it per application. If for some reason you need to do
it on run time, you should do it with a bash or bat file and set the environment before start-
ing zim. Reason is that once locale is initialized it is hard to change it on runtime.

I must change localization settings in Python itself - for the templates like the language for
calendar date (e. g. names of the days/months) and the date/time format itself (order of
day/month/year, delimiter and so on).

For 2/ I would suggest you define a "custom tool", that way you can have a back up button in the
toolbar and click it before closing down.  If you really want it on shutdown, you would write a
small plugin that connects to the exit signal of the application. See e.g. the versioncontrol
plugins for an example, they do the same.

Yep, that would work - same idea. But an automatism would be great. As I stated first:
Startup- and shutdown-code!

Many thanks and greetings

On Tue, Feb 3, 2015 at 3:49 PM, Udo Weik <WeikEngOff@xxxxxxx <mailto:WeikEngOff@xxxxxxx>> wrote:

    Hello Jaap,

        Sorry, but I don't understand the question. Maybe you can be more specific what you want to do ?

    mmh, what else can I write?
    I want to add some custom code during
    - the start of ZIM, e. g. localization settings for the templates (language for date, date/time format)
    - before ZIM is quit, e. g. for a backup of the notebooks (copy from server to the local PC)

    Many thanks and greetings

        On Wed, Jan 21, 2015 at 8:03 PM, Udo Weik <WeikEngOff@xxxxxxx <mailto:WeikEngOff@xxxxxxx> <mailto:WeikEngOff@xxxxxxx <mailto:WeikEngOff@xxxxxxx>>> wrote:


             where/how can I use startup- and shutdown-code. After Zim is started, I want
             to change some localization settings (as startup-code) and before exiting Zim
             I want to save my notebooks (shutdown-code).

             Many thanks and greetings

Follow ups