mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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>
30 lines
586 B
Python
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)
|