27 lines
679 B
Python
27 lines
679 B
Python
from pathlib import Path
|
|
from configparser import ConfigParser
|
|
|
|
class Configuration:
|
|
def __init__(self, configfilename:str|Path):
|
|
self.config:ConfigParser = ConfigParser()
|
|
self.config.read(configfilename)
|
|
|
|
@property
|
|
def debug(self) -> bool:
|
|
return self.config["DEBUG"].getboolean("debug")
|
|
|
|
@property
|
|
def clientapp_version(self) -> str:
|
|
return self.config["APP"].get("version")
|
|
|
|
@property
|
|
def app_projectname(self) -> str:
|
|
return self.config["APP"].get("projectname")
|
|
|
|
@property
|
|
def flask_secret(self) -> str:
|
|
return self.config["APP"].get("flasksecret")
|
|
|
|
|
|
|