修复编程单下发ftp路径:去掉注释
This commit is contained in:
@@ -28,20 +28,15 @@ class FtpController():
|
|||||||
logging.info("dirname:%s" % os.path.dirname(path))
|
logging.info("dirname:%s" % os.path.dirname(path))
|
||||||
directories = os.path.normpath(path).split(os.path.sep)
|
directories = os.path.normpath(path).split(os.path.sep)
|
||||||
# 切换到上级目录
|
# 切换到上级目录
|
||||||
logging.info("当前目录: %s" % self.ftp.pwd())
|
|
||||||
current_dir = '/'
|
current_dir = '/'
|
||||||
for directory in directories:
|
for directory in directories:
|
||||||
if directory:
|
if directory:
|
||||||
# 检查目录是否存在
|
# 检查目录是否存在
|
||||||
if directory in ['ZM', 'FM', 'YC', 'HC', 'QC', 'ZC']:
|
|
||||||
self.ftp.cwd(directory)
|
|
||||||
if directory in ['NC']:
|
if directory in ['NC']:
|
||||||
self.ftp.cwd(directory)
|
self.ftp.cwd(directory)
|
||||||
if directory not in ['home', 'ftp', 'ftp_root', 'NC']:
|
if directory not in ['home', 'ftp', 'ftp_root', 'NC']:
|
||||||
# 切换到新的目录
|
# 切换到新的目录
|
||||||
current_dir = os.path.join(current_dir, directory)
|
self.ftp.cwd(current_dir)
|
||||||
logging.info("current_dir:%s" % current_dir)
|
|
||||||
self.ftp.cwd(directory)
|
|
||||||
return os.path.basename(path)
|
return os.path.basename(path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Error checking file: {e}")
|
logging.error(f"Error checking file: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user