aurweb/aurweb/config.py
Lukas Fleischer 85866796a4 Move configuration to /etc/aurweb/config
Since d4fe77a (Reorganize Git interface scripts, 2016-10-08), the key
components of the aurweb SSH interface are installed system-wide. Update
the default configuration path to point to a central location.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:13:05 +02:00

30 lines
586 B
Python

import configparser
import os
_parser = None
def _get_parser():
global _parser
if not _parser:
_parser = configparser.RawConfigParser()
if 'AUR_CONFIG' in os.environ:
path = os.environ.get('AUR_CONFIG')
else:
path = "/etc/aurweb/config"
_parser.read(path)
return _parser
def get(section, option):
return _get_parser().get(section, option)
def getboolean(section, option):
return _get_parser().getboolean(section, option)
def getint(section, option):
return _get_parser().getint(section, option)