1
0
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:
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('\"', '\\\"')
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':