Customizing GNUmed client startup and shutdown

There are several built-in hooks for customization of the startup/shutdown process. this is over and above any custom shell scripts/batch files by which to launch the client, and/or hacking of the Python source code itself to achieve any needed behaviour.

Startup

shell command line

The GNUmed client accepts a few command line options. They are documented in the man page. The options are passed to the /usr/bin/gnumed launcher shell script and eventually to the gnumed.py Python launcher script.

In particular, it may be convenient to use --conf-file to specify the use of a config file other than what GNUmed would have used by default. This is addressed further in GmManualConfigFiles.

launcher shell script: /usr/bin/gnumed

The client is usually launched with the /usr/bin/gnumed shell script which is included in the release tarball. This script looks for

and executes them (in that order) if they exist. Both scripts can do anything the user launching /usr/bin/gnumed can do (unless they are setuid-root). GNUmed as a project will never overwrite those files (but your package manager may decide to provide an updated /etc/gnumed/gnumed-startup-local.sh from time to time).

launcher Python script: gnumed.py

When this script has been called the client as such is running. During startup, two hooks provide for customization:

Among other things, connecting to the backend (which can be customized as well) happens between those two hooks.

other customization of client startup (plugins, workplaces)

Additional configuration can include the selection of plugins that are to be loaded into the GNumed toolbar, and their order. This is treated further in WorkPlaces.

widget loading: Gnumed/wxGladeWidgets/

The GNUmed client launcher code gnumed.py checks for the directory ~/.gnumed/local_code/CLIENT_BRANCH/Gnumed/wxGladeWidgets. If it exists it will be made available for importing whenever GNUmed imports code from package Gnumed.wxGladeWidgets. Several conditions must be met:

The CLIENT_BRANCH part is to be replaced with the branch in which one wants to override wxGlade widgets because code may need to be different between branches.


Shutdown

During shutdown the hook shutdown-post-GUI is called when the wxPython GUI has been closed.