我的 settings.Mediaroot 包含 abc.xml、xyz.xml、pqr.xml、lmn.xml。我应该能够排除 abc.xml 和 xyz.xml 并只解析 pqr.xml 和 lmn.xml
exfiles=['abc.xml','xyz.xml']
def locatexml(pattern,exfiles=None):
for path, dirs, files in os.walk(settings.MEDIA_ROOT):
for filename in fnmatch.filter(files, pattern):
yield os.path.join(path, filename)