update connect.py

pull/26/head
kelianchun_miller 2015-11-22 20:20:04 +08:00
parent 0c42d039ff
commit c359d1e264
1 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ class Tty(object):
return False return False
@staticmethod @staticmethod
def deal_command(str_r, ssh): def deal_command(str_r):
""" """
处理命令中特殊字符 处理命令中特殊字符
""" """
@ -384,11 +384,11 @@ class SshTty(Tty):
match = pattern.search(chan_str) match = pattern.search(chan_str)
if match: if match:
VIM_FLAG = False VIM_FLAG = False
data = self.deal_command(data, self.ssh) data = self.deal_command(data)
if len(data) > 0: if len(data) > 0:
TtyLog(log=log, datetime=datetime.datetime.now(), cmd=data).save() TtyLog(log=log, datetime=datetime.datetime.now(), cmd=data).save()
else: else:
data = self.deal_command(data, self.ssh) data = self.deal_command(data)
if len(data) > 0: if len(data) > 0:
TtyLog(log=log, datetime=datetime.datetime.now(), cmd=data).save() TtyLog(log=log, datetime=datetime.datetime.now(), cmd=data).save()
data = '' data = ''