def realQuit(self, shuttime):
        if FXUI.app != None:
            if shuttime > 0:
                print "Shutdown in ", (shuttime-1), "seconds"
                from twisted.internet import reactor
                reactor.callLater(1, self.realQuit, shuttime-1)
                return

            from wallaby.frontends.qt.widgets.baseWidget import BaseWidget
            if FXUI.mainWindow is not None:
                for w in FXUI.mainWindow.findChildren(BaseWidget):
                    w.deregister(True)

            app = FXUI.app
            del FXUI.app
            del FXUI.mainWindow
            FXUI.mainWindow = FXUI.app = None

            print "Stopping Reactor"
            from twisted.internet import reactor
            reactor.stop()

            FX.info("Stopping app")
            print "Stopping App"

            app.exit(0)
            # FXUI.app.quit()
            FX.info("Bye")

            app = None
示例#2
0
    def createPeers(self):
        for p in self._dynamicPeers: p.destroy(remove=True)

        self._dynamicPeers = []

        observer = House.observer()

        for dct in self._peers:
            name = dct['name']
            if name is None or name == "None": continue

            args = {}
            if 'config' in dct: args = dct['config']

            if not args:
                try:
                    obj = observer.peer(name, self._name)
                except Exception as e:
                    FX.crit("Exception while creating instance of", name)
                    import traceback 
                    traceback.print_exc(file=sys.stdout)

            elif isinstance(args, dict):
                lst = ()

                obj = observer.peer(name, self._name, *lst, **args)

            if not obj:
                FX.crit("Error creating peer", name, "for room", self._name, "with options", args)
            else:
                FX.info("Successfully created peer", name, "for room", self._name)
                self._dynamicPeers.append(obj)