24 lines
574 B
Python
24 lines
574 B
Python
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() |