openSUSE / docmanager

Manage DocBook 5 Meta Information
http://opensuse.github.io/docmanager/index.html
GNU General Public License v3.0
6 stars 6 forks source link

Adapt DocManager with Configuration File #27

Closed tomschr closed 9 years ago

tomschr commented 9 years ago

As more and more ideas and wishes are implemented, the need to have a configuration is also more and more important. A configuration file could be used to define aliases or standard options, for example.

The DocManager configuration file can be searched in these places:

Preferred module is configparser.

mschnitzer commented 9 years ago

The user home config file will be now created if it's not exists: https://github.com/openSUSE/docmanager/commit/1288956f2e20ac14a5ecd38595c9267b818cdec4

We can improve it later after the 3.0 release.

tomschr commented 9 years ago

Excellent! :+1:

mschnitzer commented 9 years ago

@tomschr Do we really need a global config file and a config file for each repository? I'm not against it but we should decide it for the next release.

tomschr commented 9 years ago

Do we really need a global config file and a config file for each repository? I'm not against it but we should decide it for the next release.

Actually, this is a no brainer for us, very easy to implement. :smiley:

If we want it, we can pass a list of config filenames to the ConfigParser.read method. Filenames which cannot be found or opened are silently ignored. All configuration parameters are merged.

tomschr commented 9 years ago

To find the config file in current Git repository, use:

git rev-parse --show-toplevel
tomschr commented 9 years ago

Possible things to store in a config file: