mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 10:10:46 +00:00
Merge pull request #184 from setrofim/master
ANSI escape sequences stripping fixes for gem5
This commit is contained in:
commit
dc453ad891
@ -474,8 +474,8 @@ def which(name):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
_bash_color_regex = re.compile('\x1b\\[[0-9;]+m')
|
# This matches most ANSI escape sequences, not just colors
|
||||||
|
_bash_color_regex = re.compile(r'\x1b\[[0-9;]*[a-zA-Z]')
|
||||||
|
|
||||||
def strip_bash_colors(text):
|
def strip_bash_colors(text):
|
||||||
return _bash_color_regex.sub('', text)
|
return _bash_color_regex.sub('', text)
|
||||||
|
@ -444,7 +444,7 @@ class Gem5Connection(TelnetConnection):
|
|||||||
self._check_ready()
|
self._check_ready()
|
||||||
|
|
||||||
result = self._gem5_shell("ls {}".format(source))
|
result = self._gem5_shell("ls {}".format(source))
|
||||||
files = result.split()
|
files = strip_bash_colors(result).split()
|
||||||
|
|
||||||
for filename in files:
|
for filename in files:
|
||||||
dest_file = os.path.basename(filename)
|
dest_file = os.path.basename(filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user