def run(): app = QApplication(sys.argv) try: windows.init_icon() windows.data_dir() installedgames.init_db() frame = MainWindow() frame.show() app.exec_() except (socket.gaierror, httplib.BadStatusLine): error_message("An internet connection is required to use DesuraTools").exec_() pass except sqlite3.OperationalError, e: error_message("Desura must be installed to use DesuraTools".format(e)).exec_() webbrowser.open("http://www.desura.com/install") pass
def run(): app = QApplication(sys.argv) try: windows.init_icon() windows.data_dir() installedgames.init_db() frame = MainWindow() frame.show() app.exec_() except (socket.gaierror, httplib.BadStatusLine): error_message( "An internet connection is required to use DesuraTools").exec_() pass except sqlite3.OperationalError, e: error_message( "Desura must be installed to use DesuraTools".format(e)).exec_() webbrowser.open("http://www.desura.com/install") pass
def closeEvent(self, *args, **kwargs): self.logger.info("Saving to file") savefile = open(os.path.join(windows.data_dir(), 'desuratools.json'), 'w') savefile.write( json.dumps({ 'desuraname': self.current_profileid, 'steamname': self.steamID_input.currentText() })) savefile.close() QApplication.quit()
def closeEvent(self, *args, **kwargs): self.logger.info("Saving to file") savefile = open(os.path.join(windows.data_dir(), 'desuratools.json'), 'w') savefile.write( json.dumps({ 'desuraname': self.current_profileid, 'steamname': self.steamID_input.currentText() }) ) savefile.close() QApplication.quit()
def load_data(self): try: with open(os.path.join(windows.data_dir(), 'desuratools.json'), 'r') as savefile: try: data = json.loads(savefile.read()) except Exception: self.desuraAccountName_input.setText("") return self.desuraAccountName_input.setText(data['desuraname']) if data['desuraname'] != "": self.populate_owned_games() steamid = self.steamID_input.findText(data['steamname']) self.steamID_input.setCurrentIndex(steamid) except IOError: pass