def load_file(conn, csvfile):
print(csvfile)
with open(csvfile, "r") as handle:
data = handle.read()
names = []
for match in AXFR_RE.finditer(data, re.MULTILINE):
names.append((match.group(1).strip('.'), match.group(3)))
suffix = os.path.commonprefix([X[0][::-1] for X in names])[::-1]
names = filter(lambda X: X[0],
[(X[0].replace(suffix, '').strip('.').lower(), X[1])
for X in names])
lookup_names = []
for name, rectype in set(names):
if not name or name == '*': # Ignore single wildcard or empty
continue
if name[:2] == '*.': # Strip wildcard off beginning
name = name[2:]
lookup_names.append((name, rectype))
update_vfy(conn, lookup_names)
评论列表
文章目录