def get_patches_from_dir(path):
 patches = []
 for (root, subdirs, files) in core.walk(path):
  for name in [f for f in files if f.endswith(u'.patch')]:
   patches.append(core.decode(os.path.join(root, name)))
 return patches

def get_patches_from_dir ( path ) : patches = [ ] for ( root , subdirs , files ) in core . walk ( path ) : for name in [ f for f in files if f . endswith ( u'.patch' ) ] : patches . append ( core . decode ( os . path . join ( root , name ) ) ) return patches
find patches in a subdirectory .