mirror of
https://github.com/Neocky/pluGET.git
synced 2024-04-29 16:12:30 +00:00
Fixed ftp file or folder check
Changes: - fixed issue where it couldn't detect if it would be a file or folder with ftp
This commit is contained in:
parent
367ee5be42
commit
1ff34a7372
@ -100,11 +100,17 @@ def ftp_downloadFile(ftp, downloadPath, fileToDownload):
|
|||||||
ftp.quit()
|
ftp.quit()
|
||||||
|
|
||||||
|
|
||||||
def ftp_validateFileAttributes(ftp, pluginPath):
|
def ftp_is_file(FTP, pluginPath):
|
||||||
pluginFTPAttribute = ftp.lstat(pluginPath)
|
if FTP.nlst(pluginPath) == [pluginPath]:
|
||||||
if stat.S_ISDIR(pluginFTPAttribute.st_mode):
|
return True
|
||||||
return False
|
else:
|
||||||
elif re.search(r'.jar$', pluginPath):
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def ftp_validateFileAttributes(ftp, pluginPath):
|
||||||
|
if ftp_is_file(ftp, pluginPath) is False:
|
||||||
|
return False
|
||||||
|
if re.search(r'.jar$', pluginPath):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user