def check_and_call_extract_file(filepath, method_map, options_map, callback, keywords, comment_tags, strip_comment_tags, dirpath=None):
 filename = relpath(filepath, dirpath)
 for (pattern, method) in method_map:
  if (not pathmatch(pattern, filename)):
   continue
  options = {}
  for (opattern, odict) in options_map.items():
   if pathmatch(opattern, filename):
    options = odict
  if callback:
   callback(filename, method, options)
  for message_tuple in extract_from_file(method, filepath, keywords=keywords, comment_tags=comment_tags, options=options, strip_comment_tags=strip_comment_tags):
   (yield ((filename,) + message_tuple))
  break

def check_and_call_extract_file ( filepath , method_map , options_map , callback , keywords , comment_tags , strip_comment_tags , dirpath = None ) : filename = relpath ( filepath , dirpath ) for ( pattern , method ) in method_map : if ( not pathmatch ( pattern , filename ) ) : continue options = { } for ( opattern , odict ) in options_map . items ( ) : if pathmatch ( opattern , filename ) : options = odict if callback : callback ( filename , method , options ) for message_tuple in extract_from_file ( method , filepath , keywords = keywords , comment_tags = comment_tags , options = options , strip_comment_tags = strip_comment_tags ) : ( yield ( ( filename , ) + message_tuple ) ) break
checks if the given file matches an extraction method mapping .