Beispiel #1
0
    def start(self):
        self.initialize_logger(self.args.debug)
        try:
            os.makedirs(config_dir)
        except OSError:
            pass

        # Acquire a filesystem lock to prevent multiple instances from running
        lock = FilesystemLock(
            os.path.join(config_dir, "{}.lock".format(APP_NAME)))
        lock.acquire()

        logging.debug("Core starting with args: %s", self.args)
        logging.debug("Loaded config.txt settings: %s", settings)

        self.show_message()

        self.gui = Gui(self)
        self.gui.show_systray()

        reactor.callLater(0, self.start_gateways)
        reactor.run()
        for nodedir in get_nodedirs(config_dir):
            Tahoe(nodedir, executable=self.executable).kill()
        lock.release()
Beispiel #2
0
def test_lock_release(tmpdir):
    lock = FilesystemLock(os.path.join(str(tmpdir), "test.lock"))
    lock.acquire()
    lock.release()
    lock.acquire()
    lock.release()