refactor
This commit is contained in:
parent
7650571ad0
commit
5bfabb48db
1
Pipfile
1
Pipfile
@ -5,6 +5,7 @@ verify_ssl = true
|
||||
|
||||
[dev-packages]
|
||||
pycrypto = "*"
|
||||
fernet = "*"
|
||||
|
||||
[packages]
|
||||
pycrypto = "*"
|
||||
|
10
pwdfile.py
10
pwdfile.py
@ -4,13 +4,13 @@ import json
|
||||
|
||||
class Pwdfile:
|
||||
def __init__(self):
|
||||
self.keysfile = Config().get_pwdfilename()
|
||||
self.pwdsfile = Config().get_pwdfilename()
|
||||
|
||||
def read(self):
|
||||
with open(self.keysfile, mode="r") as keydata:
|
||||
return json.load(keydata)
|
||||
with open(self.pwdsfile, mode="r") as pwddata:
|
||||
return json.load(pwddata)
|
||||
|
||||
def write(self, keys):
|
||||
with open(self.keysfile, mode="w") as keydata:
|
||||
keydata.write(json.dumps(keys))
|
||||
with open(self.pwdsfile, mode="w") as pwddata:
|
||||
pwddata.write(json.dumps(keys))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user