#NEWLINE# def _check_unpack_options( extensions , function , extra_args ) : #NEWLINE# #INDENT# 'Checks what gets registered as an unpacker.' #NEWLINE# existing_extensions = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( name , info ) in _UNPACK_FORMATS . items ( ) : #NEWLINE# #INDENT# for ext in info [ 0 ] : #NEWLINE# #INDENT# existing_extensions [ ext ] = name #NEWLINE# #UNINDENT# #UNINDENT# for extension in extensions : #NEWLINE# #INDENT# if ( extension in existing_extensions ) : #NEWLINE# #INDENT# msg = '%s is already registered for "%s"' #NEWLINE# raise RegistryError ( ( msg % ( extension , existing_extensions [ extensions ] ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not isinstance ( function , collections . Callable ) ) : #NEWLINE# #INDENT# raise TypeError ( 'The registered function must be a callable' )