Complete.Org: Mailing Lists: Archives: offlineimap: July 2002:
Re: Configuration file
Home

Re: Configuration file

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Cc: offlineimap@xxxxxxxxxxxx
Subject: Re: Configuration file
From: Martijn Pieters <mj@xxxxxxxx>
Date: Wed, 24 Jul 2002 23:13:25 -0400

On Wed, Jul 24, 2002 at 09:53:15PM -0500, John Goerzen wrote:
> Right now, we have a config file format with three sections in addition to
> account names:
> 
>  * general
>  * mbnames
>  * ui.Tk.Blinkenlights
> 
> While this is following a consistent scheme ("general" for overall settings,
> all others with the Python name of their module, without leading
> "offlineimap."), it might not be best, and with no effective restructions on
> account names, each time a new section is added, we have to be concerned
> about collisions.  It's not just limited to account names with periods
> either -- there are other top-level modules threadutil, version, imaputil,
> imapserver, and imaplib that might someday want to have a config section.

I must say that I feel that too much Python syntax in the configuration file
will confuse non-programmers; one of reasons I am working on the
config-manager is to make it easier for such users to manage the
configuration without having to understand every detail of it.

For this reasons I am not sure if using module names as section identifiers
is such a good idea. I there really will be two distict Blinkenlights
packages one day, changes are they are so closely related they should share
one configuration section anyway.

However, a naming convention for arbitrary sections is never going to fully
avoid a name clash with account names; they share the same namespace and
restrictions like 'no . in account names' will not significantly reduce the
risk of collision.

What is needed is a seperate namespace for accounts and other sections. One
way this could be accomplished is by requiring all account sections to be
prepended by the word 'Account'. So, the configuration namespace has no
prefix, and the accounts namespace has the 'Account' prefix. This would look
something like:

  [general]
  ..
  accounts = ZopeCom
  ..

  [Account ZopeCom]
  ..
  ..

You can then add other namespaces for other types of configuration, such as
UI confiurations; 'UI Blinkenlights' springs to mind. Using a name like that
also doesn't bind you to a package organisation or implementation. Maybe one
day there will be a ui.wxPython.Blinkenlights instead?

-- 
Martijn Pieters
| Software Engineer  mailto:mj@xxxxxxxx
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------


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