mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-09 13:31:53 +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('\"', '\\\"')
|
||||
|
||||
|
||||
def escape_spaces(text):
|
||||
"""Escape spaces in the specified text"""
|
||||
return text.replace(' ', '\ ')
|
||||
|
||||
|
||||
def getch(count=1):
|
||||
"""Read ``count`` characters from standard input."""
|
||||
if os.name == 'nt':
|
||||
|
Reference in New Issue
Block a user