xml.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:faze 作者: KhasMek 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号