passwdtools/configuration.py

22 lines
515 B
Python
Raw Permalink Normal View History

2019-03-18 15:28:32 +00:00
from cfgfile import CfgFile
2019-03-11 16:29:14 +00:00
2019-03-12 12:27:34 +00:00
class Config:
2019-03-11 16:29:14 +00:00
def __init__(self):
2019-03-18 15:28:32 +00:00
self.cfgfile = CfgFile()
self.data = self.cfgfile.read()
2019-03-11 16:29:14 +00:00
2019-03-12 12:27:34 +00:00
def get_pwdfilename(self):
2019-03-12 15:32:12 +00:00
return self.data["pwdfilename"]
2019-03-12 12:27:34 +00:00
def set_pwdfilename(self, pwdfilename):
self.data["pwdfilename"] = pwdfilename
2019-03-18 15:28:32 +00:00
self.cfgfile.write(self.data)
2019-03-12 12:27:34 +00:00
def get_secret(self):
return self.data["secret"]
def set_secret(self, secret):
self.data["secret"] = secret
2019-03-18 15:28:32 +00:00
self.cfgfile.write(self.data)