def get_matching_docs(dirname, suffixes, exclude_matchers=()):
 suffixpatterns = [('*' + s) for s in suffixes]
 for filename in get_matching_files(dirname, exclude_matchers):
  for suffixpattern in suffixpatterns:
   if fnmatch.fnmatch(filename, suffixpattern):
    (yield filename[:((- len(suffixpattern)) + 1)])
    break

def get_matching_docs ( dirname , suffixes , exclude_matchers = ( ) ) : suffixpatterns = [ ( '*' + s ) for s in suffixes ] for filename in get_matching_files ( dirname , exclude_matchers ) : for suffixpattern in suffixpatterns : if fnmatch . fnmatch ( filename , suffixpattern ) : ( yield filename [ : ( ( - len ( suffixpattern ) ) + 1 ) ] ) break
get all file names matching a suffix in a directory .