Refactoring & install with pyproject.toml #1

Merged
lysis merged 16 commits from toml into main 2024-03-30 10:16:16 +01:00
Showing only changes of commit 4790429f24 - Show all commits

View File

@ -7,13 +7,14 @@ class Conf(object):
_cfgfiles = [] _cfgfiles = []
debug = None debug = None
def __init__(self, filename=None, debug=None): def __init__(self, filename=None, debug=None, force_filename=False):
if debug: if debug:
self.set_debug(debug) self.set_debug(debug)
filenames = [] filenames = []
if filename: if filename:
filenames.append(filename) filenames.append(filename)
filenames.append(f'{os.environ.get("HOME")}/etc/userconfig2.conf') if not force_filename:
filenames.append(f'{os.environ.get("HOME")}/etc/userconfig2.conf')
ret = self.set_filenames(filenames) ret = self.set_filenames(filenames)
if not ret: if not ret:
raise ValueError(f'Cannot open either configuration file: {",".join(filenames)}') raise ValueError(f'Cannot open either configuration file: {",".join(filenames)}')