Revert false FTP fix and solve it

This commit is contained in:
Neocky 2023-02-09 20:54:03 +01:00
parent 1fda453bbd
commit a9bac687c8
2 changed files with 2 additions and 5 deletions

View File

@ -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

View File

@ -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}")