flaschengeist/geruecht/configparser.py

24 lines
574 B
Python
Raw Normal View History

2019-12-30 08:22:43 +00:00
import yaml
class ConifgParser():
def __init__(self, file='config.yml'):
self.file = file
with open(file, 'r') as f:
self.config = yaml.load(f)
print(self.config)
self.db = self.config['Database']
self.ldap = self.config['LDAP']
self.accessTokenLifeTime = self.config['AccessTokenLifeTime']
def getLDAP(self):
return self.ldap
def getDatabase(self):
return self.db
def getAccessToken(self):
return self.accessTokenLifeTime
if __name__ == '__main__':
ConifgParser()