def register_fileformat(fileformat):
 try:
  fileformat.get_class()
  FILE_FORMATS[fileformat.format_id] = fileformat
  for autoload in fileformat.autoload:
   FILE_DETECT.append((autoload, fileformat))
 except (AttributeError, ImportError):
  add_configuration_error(u'File format: {0}'.format(fileformat.format_id), traceback.format_exc())
 return fileformat

def register_fileformat ( fileformat ) : try : fileformat . get_class ( ) FILE_FORMATS [ fileformat . format_id ] = fileformat for autoload in fileformat . autoload : FILE_DETECT . append ( ( autoload , fileformat ) ) except ( AttributeError , ImportError ) : add_configuration_error ( u'File format: {0}' . format ( fileformat . format_id ) , traceback . format_exc ( ) ) return fileformat
registers fileformat in dictionary .