def find_snippet_files(ft, directory):
 patterns = ['%s.snippets', '%s_*.snippets', os.path.join('%s', '*')]
 ret = set()
 directory = os.path.expanduser(directory)
 for pattern in patterns:
  for fn in glob.glob(os.path.join(directory, (pattern % ft))):
   ret.add(os.path.realpath(fn))
 return ret

def find_snippet_files ( ft , directory ) : patterns = [ '%s.snippets' , '%s_*.snippets' , os . path . join ( '%s' , '*' ) ] ret = set ( ) directory = os . path . expanduser ( directory ) for pattern in patterns : for fn in glob . glob ( os . path . join ( directory , ( pattern % ft ) ) ) : ret . add ( os . path . realpath ( fn ) ) return ret
returns all matching snippet files for ft in directory .