Commit 912dd534 authored by 广宏伟's avatar 广宏伟

Merged in dev (pull request #118)

[Update] sftp 去掉windows资产
parents bffa242b 4755ab3e
......@@ -88,7 +88,6 @@ class SFTPVolume(BaseVolume):
def list(self, target, name_only=False):
""" Returns a list of files/directories in the target directory. """
path = self._path(target)
print("List {} {}".format(target, path))
with self.lock:
return self._list(path)
......@@ -96,7 +95,6 @@ class SFTPVolume(BaseVolume):
""" Get the sub directory of directory
"""
path = self._path(target)
print("Tree {} {}".format(target, path))
with self.lock:
infos = self._list(path)
tree = list(filter(lambda x: x['mime'] == 'directory', infos))
......@@ -107,7 +105,6 @@ class SFTPVolume(BaseVolume):
获取目录的父目录, 如果deep为0,则直到根
"""
path = self._path(target).rstrip(self.path_sep)
print("Parents {} {}".format(target, path))
with self.lock:
return self._parents(path, depth=depth)
......@@ -173,7 +170,6 @@ class SFTPVolume(BaseVolume):
remote_path = self._remote_path(path)
try:
data = self.sftp.lstat(remote_path)
print(data)
exist = True
except FileNotFoundError:
exist = False
......@@ -188,7 +184,6 @@ class SFTPVolume(BaseVolume):
def paste(self, targets, dest, cut):
""" Moves/copies target files/directories from source to dest. """
print("Paste {} {} {}".format(targets, dest, cut))
dest_parent_path = self._path(dest)
added = []
removed = []
......@@ -198,9 +193,7 @@ class SFTPVolume(BaseVolume):
dest_path = self._join(dest_parent_path, self._base_name(src_path))
if self.is_dir(src_path):
raise OSError("Copy folder unsupported now")
print("Paste {} to => {}".format(src_path, dest_parent_path))
if self.is_exist(dest_path):
print("Exist {}".format(dest_path))
continue
src_remote_path = self._remote_path(src_path)
dest_remote_path = self._remote_path(dest_path)
......
......@@ -422,7 +422,7 @@
'minsLeft' : '剩余 $1 分钟', // from v2.1.17 added 13.11.2016
'openAsEncoding' : '使用所选编码重新打开', // from v2.1.19 added 2.12.2016
'saveAsEncoding' : '使用所选编码保存', // from v2.1.19 added 2.12.2016
'selectFolder' : '选择目录', // from v2.1.20 added 13.12.2016
'selectFolder' : '选择目录(暂不支持)', // from v2.1.20 added 13.12.2016
'firstLetterSearch': '首字母搜索', // from v2.1.23 added 24.3.2017
'presets' : '预置', // from v2.1.25 added 26.5.2017
'tooManyToTrash' : '项目太多,不能移动到回收站.', // from v2.1.25 added 9.6.2017
......
......@@ -332,7 +332,6 @@ class BaseServer:
return self._cmd_parser.parse_output(self.output_data)
def _parse_input(self):
print("Parse input: {}".format(self.input_data))
if not self.input_data:
return
return self._cmd_parser.parse_input(self.input_data)
......
......@@ -73,6 +73,8 @@ class SFTPServer(paramiko.SFTPServerInterface):
self.server.connection.user
)
for asset in assets:
if asset.protocol != 'ssh':
continue
value = {}
key = asset.hostname
if asset.org_id:
......@@ -96,7 +98,6 @@ class SFTPServer(paramiko.SFTPServerInterface):
active_channels = [c for c in trans._channels.values() if not c.closed]
if not active_channels:
print("CLose transport")
trans.close()
if proxy:
proxy.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment