def run_gui(self, config, plugins): threading.current_thread().name = 'GUI' gui_name = config.get('gui', 'qt') if gui_name in ['lite', 'classic']: gui_name = 'qt' self.logger.info(f'launching GUI: {gui_name}') try: try: gui = __import__('electrum.gui.' + gui_name, fromlist=['electrum']) except GuiImportError as e: sys.exit(str(e)) self.gui_object = gui.ElectrumGui(config=config, daemon=self, plugins=plugins) if not self._stop_entered: self.gui_object.main() else: # If daemon.stop() was called before gui_object got created, stop gui now. self.gui_object.stop() except BaseException as e: self.logger.error( f'GUI raised exception: {repr(e)}. shutting down.') raise finally: # app will exit now asyncio.run_coroutine_threadsafe(self.stop(), self.asyncio_loop).result()
def run_gui(self, config, plugins): threading.current_thread().setName('GUI') gui_name = config.get('gui', 'qt') if gui_name in ['lite', 'classic']: gui_name = 'qt' self.logger.info(f'launching GUI: {gui_name}') try: gui = __import__('electrum.gui.' + gui_name, fromlist=['electrum']) self.gui_object = gui.ElectrumGui(config, self, plugins) self.gui_object.main() except BaseException as e: self.logger.error( f'GUI raised exception: {repr(e)}. shutting down.') raise finally: # app will exit now self.on_stop()