From 431ad2940be2dcc56263df6f16b8741916a45eb1 Mon Sep 17 00:00:00 2001 From: kelianchun_miller <360271747@qq.com> Date: Thu, 26 Nov 2015 17:17:37 +0800 Subject: [PATCH] update connect.py --- connect.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connect.py b/connect.py index 9f339205e..cf9be2e17 100644 --- a/connect.py +++ b/connect.py @@ -83,7 +83,7 @@ class Tty(object): return False - def remove_obstruct_char(cmd_str): + def remove_obstruct_char(cmd_str): '''删除一些干扰的特殊符号''' control_char = re.compile(r'\x07 | \x1b\[1P | \r ', re.X) cmd_str = control_char.sub('',cmd_str.strip()) @@ -120,7 +120,7 @@ class Tty(object): """ 处理命令中特殊字符 """ - str_r = remove_obstruct_char(str_r) + str_r = self.remove_obstruct_char(str_r) result_command = '' # 最后的结果 backspace_num = 0 # 光标移动的个数 @@ -192,7 +192,7 @@ class Tty(object): if backspace_num > 0: #处理最后的退格符号 result_command = result_command[0:-backspace_num] + pattern_str - result_command = remove_control_char(result_command) + result_command = self.remove_control_char(result_command) return result_command def get_log(self):