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