Needs to do NS records and resolve value problems. Otherwise, mostly works

This commit is contained in:
Arnold Dechamps 2024-02-15 16:48:49 +01:00
parent 943a011e4a
commit 9b1e36dc81
No known key found for this signature in database
GPG key ID: AE66543374E41C89

View file

@ -4,6 +4,7 @@ Link to IANA website : https://www.internic.net/domain/root.zone
"""
import urllib.request
import zonefile_parser
import json
from tldtester.models import zonecontent
@ -24,16 +25,19 @@ def sorter(rawdata):
"""
This file removes the tabs and line breaks from rawdata
returns as a list with dictionary in it
:returns: a list of dictionaries
"""
encodeddata = zonefile_parser.parse(rawdata)
return encodeddata
properdata = []
for line in encodeddata:
properdata.append(dict(json.loads(str(line).replace("'",'"'))))
return properdata
def dbwriter(data):
"""
Writes everything in the Zone database
"""
for line in data:
print(line)
DB=zonecontent()
DB.rtype = line["rtype"]
DB.name = line["name"]