def __init__(self, config, prefix=None):
		self.manager, self.Manager = None, None
		self.Transport = None
		self.running = False
		self.config = config = Bunch(config)
		
		if prefix is not None:
			self.config = config = Bunch.partial(prefix, config)
		
		if 'manager' in config and isinstance(config.manager, dict):
			self.manager_config = manager_config = config.manager
		elif 'manager' in config:
			self.manager_config = manager_config = dict(manager_config)
		else:
			try:
				self.manager_config = manager_config = Bunch.partial('manager', config)
			except ValueError:
				self.manager_config = manager_config = dict()
		
		if 'manager' in config and isinstance(config.manager, basestring):
			warnings.warn("Use of the manager directive is deprecated; use manager.use instead.", DeprecationWarning)
			manager_config.use = config.manager
		
		try:
			if 'transport' in config and isinstance(config.transport, dict):
				self.transport_config = transport_config = Bunch(config.transport)
			else:
				self.transport_config = transport_config = Bunch.partial('transport', config)
		except (AttributeError, ValueError): # pragma: no cover
			self.transport_config = transport_config = Bunch()
		
		if 'transport' in config and isinstance(config.transport, basestring):
			warnings.warn("Use of the transport directive is deprecated; use transport.use instead.", DeprecationWarning)
			transport_config.use = config.transport
		
		try:
			if 'message' in config and isinstance(config.message, dict):
				self.message_config = Bunch(config.message)
			else:
				self.message_config = Bunch.partial('message', config)
		except (__HOLE__, ValueError):
			self.message_config = Bunch()

		self.Manager = Manager = self._load(manager_config.use if 'use' in manager_config else 'immediate', 'marrow.mailer.manager')
		
		if not Manager:
			raise LookupError("Unable to determine manager from specification: %r" % (config.manager, ))
		
		# Removed until marrow.interface is updated to use marrow.schema.
		#if not isinstance(Manager, IManager):
		#	raise TypeError("Chosen manager does not conform to the manager API.")
		
		self.Transport = Transport = self._load(transport_config.use, 'marrow.mailer.transport')
		
		if not Transport:
			raise LookupError("Unable to determine transport from specification: %r" % (config.transport, ))
		
		# Removed until marrow.interface is updated to use marrow.schema.
		#if not isinstance(Transport, ITransport):
		#	raise TypeError("Chosen transport does not conform to the transport API.")
		
		self.manager = Manager(manager_config, partial(Transport, transport_config))
dataset/ETHPy150Open marrow/mailer/marrow/mailer/__init__.py/Mailer.__init__