def __init__(self, qsotp, qdata, args, logger=None): ClientOverlay.__init__(self, type(self).__name__, qsotp, qdata, args, logger) self.name = type(self).__name__ # Logger parameters self.logger = logger self._LOGGING_ = False if logger is None else True
def __init__(self, qsotp, mode, args, logger): ClientOverlay.__init__(self, type(self).__name__, qsotp, mode, args, logger) self.name = type(self).__name__ self.buffer = [] # Setting input capture self.conn = None self.hasInput = False self.id = 0 self.timeout = 1 # Logger parameters self.logger = logger self._LOGGING_ = False if logger is None else True self.tcpthread = Thread(target=self.captureTcpStream) self.tcpthread.start()
def doOverlay(self): self.sem.acquire() self._LOGGING_ and self.logger.info(f"[Overlay] Initializing...") self.overlay = [ x for x in ClientOverlay.__subclasses__() if x.NAME == self.overlayname ][0](self.qsotp, self.qdata, self.overlayargs, self.logger) self.overlay.start() # setting sotp arguments depending on the overlay to be used self.tag = self.overlay.tag self.sem.release()
def listOverlays(type): if type == "server": overlaylist = [x for x in ServerOverlay.__subclasses__()] else: overlaylist = [x for x in ClientOverlay.__subclasses__()] overlaydict = {} for elem in overlaylist: overlaydict[elem.NAME] = elem.CONFIG["description"] output = "\nOverlay modules:\n\n" for k in sorted(overlaydict): output = output + "- {}: {}\n".format(k, overlaydict[k]) return output
def findModule(type, lst): if type == "server": for x in ServerWrapper.__subclasses__(): if x.NAME == lst: return x for x in ServerOverlay.__subclasses__(): if x.NAME == lst: return x for x in ClientWrapper.__subclasses__(): if x.NAME == lst: return x for x in ClientOverlay.__subclasses__(): if x.NAME == lst: return x return None