def get_protocol(self, ctx: Context, serv_info: tuple): """ Gets the protocol to use for this webserver. """ if not hasattr(self, "_cached_mod"): mod = importlib.import_module(self.backend) self._cached_mod = mod server = getattr(self._cached_mod, self._cached_mod.PROTOCOL_CLASS) proto = server(self, ctx, *serv_info) ctx.protocol = proto return proto