Beispiel #1
0
    def run(self):
        interval = constants.INTERVAL
        if 'interval' in self.conf:
            try:
                interval = int(self.conf['interval'])
            except ValueError:
                pass
                #weird value in conf, take default

        timer = InfiniteTimer(interval, self.check_clipboard, immediate=True)
        timer.daemon = True
        timer.start()
Beispiel #2
0
    def run(self):
        self.interval = constants.CLEAN
        if "clean" in self.conf:
            try:
                self.interval = int(self.conf["clean"])
            except ValueError:
                pass
                # weird value in conf, take default

        self.logger.info("Setting up cleaner with interval %d..." % (self.interval))
        t = InfiniteTimer(self.interval, self.clean, immediate=False)
        t.daemon = True
        t.start()
    def run(self):
        interval = constants.ANNOUNCE
        if 'announce' in self.conf:
            try:
                interval = int(self.conf['announce'])
            except ValueError:
                pass
                #weird value in conf, take default

        port = constants.PORT
        if 'port' in self.conf:
            try:
                port = int(self.conf['port'])
            except ValueError:
                #weird value in conf, take default
                pass

        self.logger.info('Setting up announcer with interval %d...' % (interval))
        t = InfiniteTimer(interval, self.announce, [port], immediate=True)
        t.daemon = True
        t.start()