def run(): app = WxAsyncApp() frame = WxAsyncAppMessageThroughputTest() loop = get_event_loop() loop.run_until_complete(app.MainLoop()) #app.__del__() return frame.results()
def __init__(self): self.app = WxAsyncApp() self.main_frame = MainFrame(None) self.remote_mod_list = ObjectList( element=self.main_frame.mod_list_list, columns=("name", "owner", "description", "latest_version", "downloads"), ) self.installed_mod_list = ObjectList( element=self.main_frame.installed_mods_list, columns=("name", "namespace", "version"), column_labels=("Name", "Author", "Version"), ) self.downloaded_mod_list = ObjectList( element=self.main_frame.downloaded_mods_list, columns=("name", "namespace", "version"), column_labels=("Name", "Author", "Version"), ) self.job_queue_list = ObjectList( element=self.main_frame.job_queue_list, columns=("name", "parameters_str"), column_labels=("Task", "Parameters"), ) risk_of_rain_path = get_install_path() if not risk_of_rain_path: wx.MessageBox( "Failed to detect Risk of Rain 2 path. Add it to config.toml", "Error", wx.OK | wx.ICON_ERROR, ) risk_of_rain_path = Path("risk-of-rain-2") self.configuration = ModManagerConfiguration( thunderstore_url="https://thunderstore.io/", mod_cache_path="mod-cache/", mod_install_path=risk_of_rain_path / "BepInEx" / "plugins", risk_of_rain_path=risk_of_rain_path, ) self.job_manager = JobManager( big_progress_bar=self.main_frame.progress_bar_big, small_progress_bar=self.main_frame.progress_bar_small, ) self.job_manager.bind_on_job_added(self.refresh_job_list) self.job_manager.bind_on_job_finished(self.refresh_job_list) self.manager = ModManager(self.configuration, self.job_manager) self.manager.bind_on_install(self.refresh_installed_mod_list) self.manager.bind_on_uninstall(self.refresh_installed_mod_list) self.manager.bind_on_download(self.refresh_downloaded_mod_list) self.manager.bind_on_delete(self.refresh_downloaded_mod_list) self.current_selection = PackageMetadata.empty() self.main_frame.selection_description.SetLabel("") self.main_frame.selection_title.SetLabel("") self.main_frame.selection_version.SetLabel("") self.main_frame.selection_download_count.SetLabel("") self.main_frame.selection_thunderstore_button.Disable() self.bind_events()
def main(): app = WxAsyncApp() frame = TitanFrame(None, title=f"{NAME} {VERSION}") frame.Show() app.SetTopWindow(frame) loop = get_event_loop() loop.run_until_complete(app.MainLoop())
def main(): # Ensure gamestate integration cfg is in csgo's cfg directory csgo_dir = get_csgo_path(os.path.join(get_steam_path(), "steamapps")) if csgo_dir is not None: copyfile( "gamestate_integration_ccs.cfg", os.path.join(csgo_dir, "csgo", "cfg", "gamestate_integration_ccs.cfg"), ) oalInit() loop = asyncio.get_event_loop() app = WxAsyncApp() gui.MainFrame( None, title="CSGO Custom Sounds", size=wx.Size(320, 230), style=wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX), ) loop.run_until_complete(app.MainLoop()) # Freeing OpenAL buffers might fail if they are still in use # We don't really care since the OS will clean up anyway. try: oalQuit() except: # noqa pass
def main_async(): # see https://github.com/sirk390/wxasync app = WxAsyncApp() frame = SelectableFrame() frame.Show(True) app.SetTopWindow(frame) loop = get_event_loop() loop.run_until_complete(app.MainLoop())
def loadGUI(self): """ Load WxPython (async) """ if self.useGUI and not self.wxApp: from wxasync import WxAsyncApp self.wxApp = WxAsyncApp() self.wxGUITask = asyncio.ensure_future(self.wxApp.MainLoop())
def createWindow(msg_queue, buffer, client_network_main, ip, port): print("Creating Window") loop = asyncio.get_event_loop() loop.create_task(client_network_main(msg_queue, buffer, ip, port)) app = WxAsyncApp() player = Player("Stream Media Player", buffer, msg_queue) player.Show() app.SetTopWindow(player) print("Running") # loop.set_debug(True) loop.run_until_complete(app.MainLoop())
async def async_gui(coroutine): loop = get_event_loop() app = WxAsyncApp() task = loop.create_task(app.MainLoop()) try: await coroutine except Exception as e: dlg = wx.MessageDialog(None, str(e), "Error") dlg.ShowModal() finally: task.cancel()
def start(): logging.basicConfig(format='[%(name)s] %(levelname)s:%(message)s', level=logging.DEBUG) app = WxAsyncApp() loop = asyncio.get_event_loop() w = MainWindow() try: loop.run_until_complete(app.MainLoop()) finally: loop.stop() loop.close()
def loadGUI(self): """ Load WxPython (async) """ from wxasync import WxAsyncApp import wx.lib.agw.persist as PM self.wxApp = WxAsyncApp() self.wxGUITask = asyncio.ensure_future(self.wxApp.MainLoop()) self.wxAppPersistMgr = PM.PersistenceManager.Get() _configFile = os.path.join(self.settingsDir, "persistGUI.cfg") self.wxAppPersistMgr.SetPersistenceFile(_configFile)
def start(): logging.basicConfig(format='[%(name)s] %(levelname)s:%(message)s', level=logging.DEBUG) log.setLoggerLevel("base.persistentobject", logging.ERROR) log.setLoggerLevel("base.modelobject", logging.ERROR) log.setLoggerLevel("base.tilecontainer", logging.ERROR) #log.setLoggerLevel("gui.tilewidgetview", logging.ERROR) log.setLoggerLevel("gui.tilesetwidget", logging.ERROR) #log.setLoggerLevel("gui.gamepanels", logging.ERROR) app = WxAsyncApp() loop = asyncio.get_event_loop() w = MainWindow() try: loop.run_until_complete(app.MainLoop()) finally: loop.stop() loop.close()
def run(): app = WxAsyncApp() app.path = os.path.dirname(sys.argv[0]) from window.main import Main import prefs import worlds import theme prefs.Initialize() worlds.Initialize() theme.Initialize() frame = Main(None, "wxpymoo") frame.Show(True) app.loop.run_until_complete(app.MainLoop())
def _real_main(): utils.insure_filesystem() utils.setup_logging() logging.info( f"Starting UtopiaForReddit version {variables.version_human_friendly}") utils.setup_caching() logging.info("Loading config and saving defaults if needed.") variables.config = config.get_config().load().save_defaults() logging.info("Starting ui framework") loop = asyncio.get_event_loop() loop.set_exception_handler(global_exception_handler) app = WxAsyncApp(loop=loop) loop.set_debug(True) am = account_manager.AccountManager(True) # The account manager is either shown or passed through. In either case, the show call, are done in the create method of the account manager. # and then the main ui will be shown. # check for updates StartCoroutine(updater.check_for_updates(), am) # Show program tips tips.show_tips(None, False) loop.run_until_complete(app.MainLoop())
def main(): app = WxAsyncApp() loop = get_event_loop() toolbar_frame = ToolbarFrame(loop, None) toolbar_frame.Show() loop.run_until_complete(app.MainLoop())
def run(): loop = get_event_loop() app = WxAsyncApp() frame = WxAsyncAsyncIOLatencyTest(loop=loop) loop.run_until_complete(app.MainLoop()) return frame.results()
async def main(): app = WxAsyncApp() frame = TestFrame() frame.Show() app.SetTopWindow(frame) await app.MainLoop()
async def run_app(): app = WxAsyncApp() main_window = MainWindow() main_window.Show() app.SetTopWindow(main_window) await app.MainLoop()
def main(): app = WxAsyncApp() frame = TitanPatcherFrame(None, title=f"Titan Patcher") app.SetTopWindow(frame) loop = get_event_loop() loop.run_until_complete(app.MainLoop())
self.dwbtn = wx.Button(panel, label='下载', size=(-1, 27)) grid_sizer.AddMany([(self.tag_ctrl, 1, wx.EXPAND), (self.begin), (self.end), (self.dwbtn)]) AsyncBind(wx.EVT_BUTTON, self.download, self.dwbtn) box_sizer.Add(grid_sizer, 1, wx.ALL | wx.CENTER, 20) self.img_list = wx.ListCtrl(panel, -1, style=wx.LC_REPORT) self.img_list.InsertColumn(0, '图片名') box_sizer.Add(self.img_list, 1, wx.EXPAND | wx.ALL ^ wx.TOP, 20) panel.SetSizer(box_sizer) self.Centre() async def download(self, evt): pass if __name__ == '__main__': app = WxAsyncApp() frame = MainFrame() app.SetTopWindow(frame) frame.Show() evt = asyncio.get_event_loop() evt.run_until_complete(app.MainLoop())
def run(): loop = get_event_loop() app = WxAsyncApp() frame = WxAsyncAppCombinedThroughputTest(loop=loop) loop.run_until_complete(app.MainLoop()) return frame.results()
def start_gui(): """start the GUI""" return WxAsyncApp()
async def main(): app = WxAsyncApp() asyncio.create_task(opendialog()) await app.MainLoop()
def wx_app(): app = WxAsyncApp() return app