import asyncio import quamash from modules.mainwindow import MainWindow from modules.User import User ICON = "img/emotiv_icon.png" if __name__ == "__main__": user = User() app = QApplication(sys.argv) loop = quamash.QEventLoop(app) asyncio.set_event_loop(loop) main_window = MainWindow(user, loop) loop.run_until_complete(main_window.setup_device()) try: loop_tasks = [ asyncio.ensure_future(main_window.device.read_data()), asyncio.ensure_future(main_window.device.update_console()), asyncio.ensure_future(main_window.read_data()), asyncio.ensure_future(main_window.update_curves()) ] finished, pending = loop.run_until_complete( asyncio.wait(loop_tasks)) except KeyboardInterrupt: main_window.device.running = False for task in pending: task.cancel()
def openmainwindow(): test = Toplevel(window) mainwindow = MainWindow(test) mainwindow.grid(column=1, row=1)
name = 'RigIt' version = '0.4.0' wiki = 'https://implyingrigged.info/wiki/RigIt' repository = 'https://github.com/the4chancup/RigIt/' welcomeText = '''WARNING: this tool is in its beta phase and may not work correctly. Backup before editing and be careful!''' if __name__ == '__main__': # Compile *.ui files (only if not run as a stand-alone) if (not hasattr(sys, "frozen") and not imp.is_frozen("__main__")): uic.compileUiDir('ui') # Prepare main window from modules.mainwindow import MainWindow # import after compilation app = QApplication(sys.argv) mainWindow = MainWindow() mainWindow.setWindowTitle(name + ' v' + version) # Prepare status bar versionString = '<a href=\'' + repository + '\'>' + 'v' + version + '</a>' versionLabel = QLabel(versionString) versionLabel.setOpenExternalLinks(True) mainWindow.statusbar.insertPermanentWidget(0, versionLabel) websiteLabel = QLabel('<a href=\'' + wiki + '\'>' + wiki + '</a>') websiteLabel.setOpenExternalLinks(True) mainWindow.statusbar.insertPermanentWidget(0, websiteLabel) decrypterText = '<a href="https://github.com/tunabrain4cc/pes16decrypter">' decrypterText += 'pes16decrypter</a> status: ' if (EditFile.crypterAvailable()): decrypterText += 'found' else: