def _find_cfgs(path, cfgs=None):
 ignored = ['var', 'parts']
 dirs = []
 if (not cfgs):
  cfgs = []
 for i in os.listdir(path):
  fi = os.path.join(path, i)
  if (fi.endswith('.cfg') and os.path.isfile(fi)):
   cfgs.append(fi)
  if (os.path.isdir(fi) and (i not in ignored)):
   dirs.append(fi)
 for fpath in dirs:
  for (p, ids, ifs) in os.walk(fpath):
   for i in ifs:
    if i.endswith('.cfg'):
     cfgs.append(os.path.join(p, i))
 return cfgs

def _find_cfgs ( path , cfgs = None ) : ignored = [ 'var' , 'parts' ] dirs = [ ] if ( not cfgs ) : cfgs = [ ] for i in os . listdir ( path ) : fi = os . path . join ( path , i ) if ( fi . endswith ( '.cfg' ) and os . path . isfile ( fi ) ) : cfgs . append ( fi ) if ( os . path . isdir ( fi ) and ( i not in ignored ) ) : dirs . append ( fi ) for fpath in dirs : for ( p , ids , ifs ) in os . walk ( fpath ) : for i in ifs : if i . endswith ( '.cfg' ) : cfgs . append ( os . path . join ( p , i ) ) return cfgs
find all buildout configs in a subdirectory .