gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Workplaces and Languages was Re: [Gnumed-devel] Release 0.5.rc3


From: Karsten Hilbert
Subject: Re: Workplaces and Languages was Re: [Gnumed-devel] Release 0.5.rc3
Date: Thu, 9 Jul 2009 16:13:34 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, Jul 08, 2009 at 12:54:18PM -0700, Jim Busser wrote:

> I am still having trouble with how and where "workplace level" works  

It is very easy. Consider the following pseudo-table:

table config_item (
        pk serial primary key,
        fk_workplace integer,
        fk_gnumed_user integer,
        option_name text,
        option_value
)

Does that make it any clearer ?

The plugin load list is a bit of a special case. When
loading/saving that option GNUmed simply disregards the
fk_gnumed_user and *just* looks at the fk_workplace.

With some other options GNUmed disregards the workplace such
that the user will have the same setting across all
workplaces.

> I appreciate that a workplace (a selection of plugins and their  
> sequence) is able to be set at
> - explicitly-called .conf file, failing which
> - system user ~/.gnumed/gnumed.conf, failing which
> - ./gnumed.conf (the directory from which gnumed is invoked), failing which
> - the machine OS level  /etc/gnumed/gnumed-client.conf, failing which
>
> and, if not declared in one of the above, the selection of workplace  
> will be as last saved in the database (default = "GNUmed default")

Well, there is still some confusion in the above.

The database and only the database holds:

a) the list of configured workplaces
b) the list of plugins to load for each workplace

The local configuration files only tell GNUmed *which*
workplace (name) to assume as its "identity", or "profile".

The order in which .conf files are taken into account
depends on the actual option being read from them. Regarding
the workplace name, it is within the following code snippet:

                self.__active_workplace = gmTools.coalesce (
                        _cfg.get (
                                group = u'workplace',
                                option = u'name',
                                source_order = [
                                        ('explicit', 'return'),
                                        ('workbase', 'return'),
                                        ('local', 'return'),
                                        ('user', 'return'),
                                        ('system', 'return'),
                                ]
                        ),
                        u'GNUmed Default'
                )

meaning:

        1) --conf-file=...
        2) the current working dir (where you ran gnumed)
        3) near gnumed.py
        4) ~/.gnumed/gnumed.conf (or equivalent)
        5) /etc/gnumed/gnumed-client.conf (or equivalent)

Note that when above you say "... failing which ..." that
isn't quite correct either. The first one found is used,
thus overriding any "more system-wide" values.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]