Ejemplo n.º 1
0
	def __init__(self):
		logger = logging.getLogger(self._logging_prefix + self.name + '.' + self.__class__.__name__)
		self.logger = utilities.PrefixLoggerAdapter("[plugin: {0}]".format(self.name), logger, {})
		if getattr(self, 'config') is None:  # hasattr will return False with subclass properties
			self.config = {}
			"""The plugins configuration dictionary for storing the values of it's options."""
		for option in self.options:
			if option.name in self.config:
				continue
			self.config[option.name] = option.default
Ejemplo n.º 2
0
	def __init__(self, request, client_address, server, **kwargs):
		self.logger = utilities.PrefixLoggerAdapter("{0}:{1}".format(client_address[0], client_address[1]), self._logger, {})
		self.logger.debug("tid: 0x{0:x} running http request handler".format(threading.current_thread().ident))
		# this is for attribute documentation
		self.config = None
		"""A reference to the main server instance :py:attr:`.KingPhisherServer.config`."""
		self.path = None
		"""The resource path of the current HTTP request."""
		self.rpc_session = None
		self.rpc_session_id = None
		self.semaphore_acquired = False
		self._session = None
		super(KingPhisherRequestHandler, self).__init__(request, client_address, server, **kwargs)