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.
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
launcher shell script and eventually to the
Python launcher script.
In particular, it may be convenient to use
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:
The client is usually launched with the
shell script which is included in the release tarball. This script looks for
- can be used for site-wide "local" customization
- can be used for user-specific customization
and executes them (in that order) if they exist. Both scripts can do anything the user launching
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
from time to time).
launcher Python script:
When this script has been called the client as such is running. During startup, two hooks
provide for customization:
- this is called before the wxPython GUI is initialized
- this is called after the wxPython GUI has been initialized but before flow control is handed to user input
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
The GNUmed client launcher code
checks for the directory
. If it exists it will be made available for importing whenever GNUmed imports code from package
. Several conditions must be met:
- permissions of
~/.gnumed/local_code/CLIENT_BRANCH/Gnumed/wxGladeWidgets must be
- no files or directories other than
__init__.pyc may exist within
__init__.py files must exist in
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.
During shutdown the hook
is called when the wxPython GUI has been closed.