mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-10 05:51:54 +01:00
utils/misc: Add method to escape spaces
This commit is contained in:
@@ -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':
|
||||||
|
Reference in New Issue
Block a user