Archived
1
0

Start outsourcing KeePass handling into kpwriter.py

This commit is contained in:
2021-08-19 00:25:39 +02:00
parent 5847073699
commit ad69b83aa6
3 changed files with 26 additions and 8 deletions

View File

@ -26,10 +26,13 @@ class OnepifEntry():
def __init__(self, data):
self.raw = data
if data["typeName"] not in TYPES:
raise Exception("Unknown record type: {}".format(data["typeName"]))
self.type = data["typeName"]
self.type_name = TYPES[data["typeName"]]
self.set_type(data["typeName"])
def set_type(self, new_type):
if new_type not in TYPES:
raise Exception("Unknown record type: {}".format(new_type))
self.type = new_type
self.type_name = TYPES[new_type]
def __getattr__(self, name):
if name not in self.raw: