def openFile(self): # executing file add_link_dictionary = self.download_info_file_list[9] file_path = add_link_dictionary['file_path'] if os.path.isfile(file_path): osCommands.xdgOpen(file_path) self.close()
def openFile(self): # execute file file_path = self.add_link_dict['download_path'] if os.path.isfile(file_path): osCommands.xdgOpen(file_path) # close window self.close()
def openFolder(self): # open download folder add_link_dictionary = self.download_info_file_list[9] file_path = add_link_dictionary['file_path'] file_name = os.path.basename(file_path) file_path_split = file_path.split(file_name) del file_path_split[-1] download_path = file_name.join(file_path_split) if os.path.isdir(download_path): osCommands.xdgOpen(download_path) self.close()
def openFolder(self): # open download folder file_path = self.add_link_dict['download_path'] file_name = os.path.basename(file_path) file_path_split = file_path.split(file_name) del file_path_split[-1] download_path = file_name.join(file_path_split) if os.path.isdir(download_path): osCommands.xdgOpen(download_path) # close window self.close()
def openFolder(self): # open download folder download_path = self.add_link_dict['download_path'] # file_name = os.path.basename(file_path) # file_path_split = file_path.split(file_name) # del file_path_split[-1] # download_path = file_name.join(file_path_split) if os.path.isfile(download_path): osCommands.xdgOpen(download_path, 'folder', 'file') # close window self.close()
def updateCheck(self, button): self.check_button.setText( QCoreApplication.translate("update_src_ui_tr", 'Checking...')) try: # get information dictionary from github updatesource = requests.get( 'https://persepolisdm.github.io/version') updatesource_text = updatesource.text updatesource_dict = ast.literal_eval(updatesource_text) # get latest stable version server_version = updatesource_dict['version'] # Comparison if float(server_version) > float(self.client_version): self.status_label.setText( QCoreApplication.translate( "update_src_ui_tr", 'A newer Persepolis release is available')) if os_type == OS.WINDOWS: self.winUpdatedl() # this function download latest release # find system architect if platform.architecture()[0] == '64bit': osCommands.xdgOpen(updatesource_dict['win64dlurl']) elif platform.architecture()[0] == '32bit': osCommands.xdgOpen(updatesource_dict['win32dlurl']) elif os_type == OS.OSX: osCommands.xdgOpen( updatesource_dict['macdlurl'] ) # it will download latest release for mac elif float(server_version) == float(self.client_version): self.status_label.setText( QCoreApplication.translate( "update_src_ui_tr", 'Latest version is installed :)')) elif float(server_version) < float(self.client_version): self.status_label.setText( QCoreApplication.translate("update_src_ui_tr", 'You are using beta version')) except Exception as e: self.status_label.setText( QCoreApplication.translate( "update_src_ui_tr", 'An error occurred while checking for updates.')) self.check_button.setText( QCoreApplication.translate("update_src_ui_tr", 'Check for new update'))
def updateCheck(self, button): self.check_button.setText('Checking...') try: # get information dictionary from github updatesource = requests.get('https://persepolisdm.github.io/version') updatesource_text = updatesource.text updatesource_dict = ast.literal_eval(updatesource_text) # get latest stable version server_version = updatesource_dict['version'] # Comparison if float(server_version) > float(self.client_version): self.status_label.setText('A newer Persepolis release is available') if os_type == 'Windows': self.winUpdatedl() # this function download latest release # find system architect if platform.architecture()[0] == '64bit': osCommands.xdgOpen(dictvalue['win64dlurl']) elif platform.architecture()[0] == '32bit': osCommands.xdgOpen(dictvalue['win32dlurl']) elif os_type == 'Darwin': osCommands.xdgOpen(dictvalue['macdlurl']) # it will download latest release for mac elif float(server_version) == float(self.client_version): self.status_label.setText('Latest version is installed :)') elif float(server_version) < float(self.client_version): self.status_label.setText('You are using beta version') except Exception as e: self.status_label.setText('an error occured while checking update.') self.check_button.setText('Check for new update')
def reportPushButtonPressed(self, button): osCommands.xdgOpen('https://github.com/persepolisdm/persepolis/issues')