1
0
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:
Marc Bonnici 2017-12-08 18:06:24 +00:00 committed by setrofim
parent 7393ab757e
commit 0dde18bb56

View File

@ -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':