mirror of
				https://github.com/Neocky/pluGET.git
				synced 2024-04-29 16:12:30 +00:00 
			
		
		
		
	Revert false FTP fix and solve it
This commit is contained in:
		@@ -136,7 +136,7 @@ def ftp_list_files_in_server_root(ftp):
 | 
			
		||||
        rich_print_error("Error: [FTP]: No Serverjar was found.")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def ftp_download_file(ftp, file) -> None:
 | 
			
		||||
def ftp_download_file(ftp, path_download, file) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    Download a file of the ftp server
 | 
			
		||||
 | 
			
		||||
@@ -147,13 +147,10 @@ def ftp_download_file(ftp, file) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    config_values = config_value()
 | 
			
		||||
    ftp.cwd(config_values.remote_plugin_folder_on_server)
 | 
			
		||||
    current_directory = os.getcwd()
 | 
			
		||||
    os.chdir('TempSFTPFolder')
 | 
			
		||||
    filedata = open(path_download,'wb')
 | 
			
		||||
    ftp.retrbinary('RETR '+file, filedata.write)
 | 
			
		||||
    filedata.close()
 | 
			
		||||
    ftp.quit()
 | 
			
		||||
    os.chdir(current_directory)
 | 
			
		||||
    return None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -225,8 +225,8 @@ def egg_cracking_jar(plugin_file_name: str) -> str:
 | 
			
		||||
        case "ftp":
 | 
			
		||||
            path_temp_plugin_folder = create_temp_plugin_folder()
 | 
			
		||||
            connection = ftp_create_connection()
 | 
			
		||||
            ftp_download_file(connection, plugin_file_name)
 | 
			
		||||
            path_plugin_jar = Path(f"{path_temp_plugin_folder}/{plugin_file_name}")
 | 
			
		||||
            ftp_download_file(connection, path_plugin_jar, plugin_file_name)
 | 
			
		||||
        case _:
 | 
			
		||||
            path_plugin_folder = config_values.path_to_plugin_folder
 | 
			
		||||
            path_plugin_jar = Path(f"{path_plugin_folder}/{plugin_file_name}")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user