def validatenmapxml(phase1):
for file in os.listdir(phase1):
file = os.path.join(phase1, file)
files_to_parse = ParseConfig().files_to_parse
try:
ET.parse(file)
logging.debug("Adding {f} to list of files to parse"
.format(f=file))
files_to_parse.append(file)
except ParseError:
logging.warning("{f} is malformed or not an xml".format(f=file))
print("{e} {f} is malformed or not an xml".format(e=cterr, f=file))
pass
except IOError:
# File is a directory.
pass
return files_to_parse
评论列表
文章目录