Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
1bbd685a
Commit
1bbd685a
authored
Nov 26, 2015
by
kelianchun_miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update connect.py
parent
431ad294
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
connect.py
connect.py
+5
-5
No files found.
connect.py
View file @
1bbd685a
...
@@ -83,7 +83,7 @@ class Tty(object):
...
@@ -83,7 +83,7 @@ class Tty(object):
return
False
return
False
def
remove_obstruct_char
(
cmd_str
):
def
remove_obstruct_char
(
self
,
cmd_str
):
'''删除一些干扰的特殊符号'''
'''删除一些干扰的特殊符号'''
control_char
=
re
.
compile
(
r'\x07 | \x1b\[1P | \r '
,
re
.
X
)
control_char
=
re
.
compile
(
r'\x07 | \x1b\[1P | \r '
,
re
.
X
)
cmd_str
=
control_char
.
sub
(
''
,
cmd_str
.
strip
())
cmd_str
=
control_char
.
sub
(
''
,
cmd_str
.
strip
())
...
@@ -93,7 +93,7 @@ class Tty(object):
...
@@ -93,7 +93,7 @@ class Tty(object):
return
cmd_str
return
cmd_str
def
remove_control_char
(
result_command
):
def
remove_control_char
(
self
,
result_command
):
"""
"""
处理日志特殊字符
处理日志特殊字符
"""
"""
...
@@ -107,10 +107,10 @@ class Tty(object):
...
@@ -107,10 +107,10 @@ class Tty(object):
[\x80-\x9f] | (?:\x1b\]0.*) | \[.*@.*\][\$#] | (.*mysql>.*) #匹配 所有控制字符
[\x80-\x9f] | (?:\x1b\]0.*) | \[.*@.*\][\$#] | (.*mysql>.*) #匹配 所有控制字符
"""
,
re
.
X
)
"""
,
re
.
X
)
result_command
=
control_char
.
sub
(
''
,
result_command
.
strip
())
result_command
=
control_char
.
sub
(
''
,
result_command
.
strip
())
global
VIM_FLAG
if
not
VIM_FLAG
:
if
not
self
.
vim_flag
:
if
result_command
.
startswith
(
'vi'
)
or
result_command
.
startswith
(
'fg'
):
if
result_command
.
startswith
(
'vi'
)
or
result_command
.
startswith
(
'fg'
):
VIM_FLAG
=
True
self
.
vim_flag
=
True
return
result_command
.
decode
(
'utf8'
,
"ignore"
)
return
result_command
.
decode
(
'utf8'
,
"ignore"
)
else
:
else
:
return
''
return
''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment