mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 10:10:46 +00:00
utils/misc: Add method to escape spaces
This commit is contained in:
parent
7393ab757e
commit
0dde18bb56
@ -414,6 +414,11 @@ def escape_double_quotes(text):
|
|||||||
return re.sub(r'\\("|\')', r'\\\\\1', text).replace('\"', '\\\"')
|
return re.sub(r'\\("|\')', r'\\\\\1', text).replace('\"', '\\\"')
|
||||||
|
|
||||||
|
|
||||||
|
def escape_spaces(text):
|
||||||
|
"""Escape spaces in the specified text"""
|
||||||
|
return text.replace(' ', '\ ')
|
||||||
|
|
||||||
|
|
||||||
def getch(count=1):
|
def getch(count=1):
|
||||||
"""Read ``count`` characters from standard input."""
|
"""Read ``count`` characters from standard input."""
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user