mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
git-interface: Factor out configuration file parsing
Add a new module that automatically locates the configuration file and provides methods to obtain the values of configuration options. Use the new module instead of ConfigParser everywhere. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
2915abb9d3
commit
2f5f5583be
5 changed files with 32 additions and 18 deletions
|
@ -1,16 +1,13 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import configparser
|
||||
import os
|
||||
import re
|
||||
import shlex
|
||||
import sys
|
||||
|
||||
import config
|
||||
import db
|
||||
|
||||
config = configparser.RawConfigParser()
|
||||
config.read(os.path.dirname(os.path.realpath(__file__)) + "/../conf/config")
|
||||
|
||||
repo_path = config.get('serve', 'repo-path')
|
||||
repo_regex = config.get('serve', 'repo-regex')
|
||||
git_shell_cmd = config.get('serve', 'git-shell-cmd')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue