mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Use setuptools to install Python modules
Instead of using relative imports, add support for installing the config and db Python modules to a proper location using setuptools. Change all git-interface scripts to access those modules from the search path. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
1946486a67
commit
dc3fd60715
10 changed files with 66 additions and 42 deletions
|
@ -1,31 +0,0 @@
|
|||
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:
|
||||
relpath = "/../conf/config"
|
||||
path = os.path.dirname(os.path.realpath(__file__)) + relpath
|
||||
_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)
|
Loading…
Add table
Add a link
Reference in a new issue