Example #1
0
def engine_status(game, url_s):
    #First check if there is error regarding engine download
    if os.path.isfile(recultis_dir + "error.txt") == True:
        error_file = open(recultis_dir + "error.txt", "r")
        error_message = error_file.read()
        error_file.close()
        os.remove(recultis_dir + "error.txt")
        return error_message, 0
    #Now check engine download status
    from games import installer
    file_path = installer.game_info(game, ["deb_file_path"])[0]
    status = "Downloading engine"
    percent = 0
    disk_s = 0
    if os.path.isfile(file_path) == True:
        f = open(file_path, "rb")
        disk_s = int(len(f.read()))
        f.close()
        percent = 95 * disk_s / url_s
        status = "Downloading engine"
    elif os.path.isdir(recultis_dir + "tmp") == True:
        status = "Installing engine"
        percent = 96
    else:
        status = "Game installation completed"
        percent = 100
    return status, percent
Example #2
0
 def update_progress_bar(self):
     global game_list
     game_nr = 0
     for radio_button in self.radio_list:
         if radio_button.isChecked() == True:
             game_list[game_nr] = [game_list[game_nr][0], 3]
             game = game_list[game_nr][0]
             radio_button.setText(
                 update_do.game_update_desc(game_list[game_nr]))
         else:
             game_nr += 1
     print("Game list looks like:")
     print(game_list)
     for push_button in self.push_buttons_list:
         push_button.setEnabled(False)
         #Workaround bug, when enabled buttons sometimes are not returning to black color
         push_button.setStyleSheet('QPushButton {color: gray}')
     time.sleep(0.5)
     percent = 0
     engine_and_runtime_size = installer.game_info(
         game, ["engine_size", "runtime_size"])
     if self.shop_radio_list[0].isChecked():
         game_shop = "none"
     elif self.shop_radio_list[1].isChecked():
         game_shop = "steam"
     elif self.shop_radio_list[2].isChecked():
         game_shop = "gog"
     while percent != 100:
         result, percent = status.check(game, game_shop,
                                        engine_and_runtime_size[0],
                                        engine_and_runtime_size[1])
         self.result_text.emit(result)
         self.percent_num.emit(percent)
         time.sleep(1)
         if "Warning" in result:
             print(result)
             self.status_warning.emit(
                 1)  #This should not allways be 1. 1 Represent Guard Key.
             while "Warning" in result:
                 result, percent = status.check(game, game_shop,
                                                engine_and_runtime_size[0],
                                                engine_and_runtime_size[1])
                 time.sleep(1)
         elif "Error" in result:
             print(result)
             #Clear currently installing game value after installation finished
             self.installing_game = ""
             return 0
     #Clear currently installing game value after installation finished
     self.installing_game = ""
     game_list[game_nr] = [game_list[game_nr][0], 1]
Example #3
0
def game_update_status(game_list, recultis_dir):
    link_string_list = get_link_list(game_list)
    from games import installer
    status_list = []
    game_nr = 0
    for game in game_list:
        game_info = installer.game_info(game, ["version"])
        version = game_info[0]
        if version != "No proper install":
            status = 1
            if version != link_string_list[game_nr]:
                status = 2
        else:
            status = 0
        game_nr += 1
        print(game + " status is " + str(status))
        status_list.append(status)
    return status_list
Example #4
0
def engine_status(game, url_s):
    from games import installer
    file_path = installer.game_info(game, ["deb_file_path"])[0]
    status = "Downloading engine"
    percent = 0
    disk_s = 0
    if os.path.isfile(file_path) == True:
        f = open(file_path, "rb")
        disk_s = int(len(f.read()))
        f.close()
        percent = 95 * disk_s / url_s
        status = "Downloading engine"
    elif os.path.isdir(recultis_dir + "tmp") == True:
        status = "Installing engine"
        percent = 96
    else:
        status = "Game installation completed"
        percent = 100
    return status, percent