def make_plugin(config): smtp_config = SmtpConfig(config) p = Plugin() p.username = smtp_config.username p.sendmail = SmtpSender(smtp_config) return p
def make_plugin(config): ident_config = IdentConfig(config) p = Plugin() factory = Factory() factory.protocol = IdentProtocol factory.user = ident_config.user p.add_service(internet.TCPServer(ident_config.port, factory)) return p
def make_plugin(config): http_config = HttpConfig(config) root = resource.Resource() harold = resource.Resource() root.putChild('harold', harold) site = server.Site(root) site.displayTracebacks = False plugin = Plugin() plugin.root = harold plugin.secret = http_config.secret plugin.add_service(internet.TCPServer(http_config.port, site)) return plugin
def make_plugin(config): http_config = HttpConfig(config) root = resource.Resource() harold = resource.Resource() root.putChild('harold', harold) site = server.Site(root) site.displayTracebacks = False endpoint = serverFromString(reactor, http_config.endpoint) service = internet.StreamServerEndpointService(endpoint, site) plugin = Plugin() plugin.root = harold plugin.secret = http_config.secret plugin.add_service(service) return plugin
def make_plugin(config): http_config = HttpConfig(config) root = resource.Resource() harold = resource.Resource() root.putChild('harold', harold) site = server.Site(root) site.displayTracebacks = False endpoint = serverFromString(reactor, http_config.endpoint) service = internet.StreamServerEndpointService(endpoint, site) plugin = Plugin() plugin.root = harold plugin.hmac_secret = http_config.hmac_secret plugin.add_service(service) return plugin
def __init__(self, database): Plugin.__init__(self) self.database = database
def __init__(self, db_config): Plugin.__init__(self) self.module, kwargs = db_config.get_module_and_params() ConnectionPool.__init__(self, self.module.__name__, **kwargs)