def registerAdapter(adapterFactory, origInterface, *interfaceClasses):
 self = globalRegistry
 assert interfaceClasses, 'You need to pass an Interface'
 global ALLOW_DUPLICATES
 if (not isinstance(origInterface, interface.InterfaceClass)):
  origInterface = declarations.implementedBy(origInterface)
 for interfaceClass in interfaceClasses:
  factory = self.registered([origInterface], interfaceClass)
  if ((factory is not None) and (not ALLOW_DUPLICATES)):
   raise ValueError(('an adapter (%s) was already registered.' % (factory,)))
 for interfaceClass in interfaceClasses:
  self.register([origInterface], interfaceClass, '', adapterFactory)

def registerAdapter ( adapterFactory , origInterface , * interfaceClasses ) : self = globalRegistry assert interfaceClasses , 'You need to pass an Interface' global ALLOW_DUPLICATES if ( not isinstance ( origInterface , interface . InterfaceClass ) ) : origInterface = declarations . implementedBy ( origInterface ) for interfaceClass in interfaceClasses : factory = self . registered ( [ origInterface ] , interfaceClass ) if ( ( factory is not None ) and ( not ALLOW_DUPLICATES ) ) : raise ValueError ( ( 'an adapter (%s) was already registered.' % ( factory , ) ) ) for interfaceClass in interfaceClasses : self . register ( [ origInterface ] , interfaceClass , '' , adapterFactory )
register an adapter class .