示例#1
0
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
示例#2
0
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
示例#3
0
 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()
示例#4
0
 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()
示例#5
0
 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
示例#6
0
 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