def get_processor(format, mapping):
 try:
  obj_info = mapping[format]
 except KeyError:
  if (format is None):
   raise ValueError('Format required (lower case string)')
  elif (not isinstance(format, basestring)):
   raise TypeError('Need a string for the file format (lower case)')
  elif (format != format.lower()):
   raise ValueError(('Format string %r should be lower case' % format))
  else:
   raise ValueError(('Unknown format %r. Supported formats are %r' % (format, "', '".join(mapping))))
 (mod_name, obj_name) = obj_info
 mod = __import__(('Bio.SearchIO.%s' % mod_name), fromlist=[''])
 return getattr(mod, obj_name)

def get_processor ( format , mapping ) : try : obj_info = mapping [ format ] except KeyError : if ( format is None ) : raise ValueError ( 'Format required (lower case string)' ) elif ( not isinstance ( format , basestring ) ) : raise TypeError ( 'Need a string for the file format (lower case)' ) elif ( format != format . lower ( ) ) : raise ValueError ( ( 'Format string %r should be lower case' % format ) ) else : raise ValueError ( ( 'Unknown format %r. Supported formats are %r' % ( format , "', '" . join ( mapping ) ) ) ) ( mod_name , obj_name ) = obj_info mod = __import__ ( ( 'Bio.SearchIO.%s' % mod_name ) , fromlist = [ '' ] ) return getattr ( mod , obj_name )
returns the object to process the given format according to the mapping .