def _find_collections(root):
 packages = []
 for (dirname, subdirs, files) in os.walk(root):
  for filename in files:
   if filename.endswith(u'.xml'):
    xmlfile = os.path.join(dirname, filename)
    (yield ElementTree.parse(xmlfile).getroot())

def _find_collections ( root ) : packages = [ ] for ( dirname , subdirs , files ) in os . walk ( root ) : for filename in files : if filename . endswith ( u'.xml' ) : xmlfile = os . path . join ( dirname , filename ) ( yield ElementTree . parse ( xmlfile ) . getroot ( ) )
helper for build_index(): yield a list of elementtree .