45 lines
1.9 KiB
Diff
45 lines
1.9 KiB
Diff
diff --git a/configshell/console.py b/configshell/console.py
|
|
index 8f72fa0..e73a27a 100644
|
|
--- a/configshell/console.py
|
|
+++ b/configshell/console.py
|
|
@@ -36,7 +36,7 @@ class Console(object):
|
|
_escape = '\033['
|
|
_ansi_format = _escape + '%dm%s'
|
|
_ansi_reset = _escape + '0m'
|
|
- _re_ansi_seq = re.compile('(\033\[..?m)')
|
|
+ _re_ansi_seq = re.compile(r'(\033\[..?m)')
|
|
|
|
_ansi_styles = {'bold': 1,
|
|
'underline': 4,
|
|
diff --git a/configshell/shell.py b/configshell/shell.py
|
|
index 437186d..ec7a239 100644
|
|
--- a/configshell/shell.py
|
|
+++ b/configshell/shell.py
|
|
@@ -113,22 +113,22 @@ class ConfigShell(object):
|
|
|
|
# Grammar of the command line
|
|
command = locatedExpr(Word(alphanums + '_'))('command')
|
|
- var = Word(alphanums + '?;&*$!#,=_\+/.<>()~@:-%[]')
|
|
+ var = Word(alphanums + r'?;&*$!#,=_\+/.<>()~@:-%[]')
|
|
value = var
|
|
- keyword = Word(alphanums + '_\-')
|
|
+ keyword = Word(alphanums + r'_\-')
|
|
kparam = locatedExpr(keyword + Suppress('=') + Optional(value, default=''))('kparams*')
|
|
pparam = locatedExpr(var)('pparams*')
|
|
parameter = kparam | pparam
|
|
parameters = OneOrMore(parameter)
|
|
bookmark = Regex('@([A-Za-z0-9:_.]|-)+')
|
|
- pathstd = Regex('([A-Za-z0-9:_.\[\]]|-)*' + '/' + '([A-Za-z0-9:_.\[\]/]|-)*') \
|
|
+ pathstd = Regex(r'([A-Za-z0-9:_.\[\]]|-)*' + '/' + r'([A-Za-z0-9:_.\[\]/]|-)*') \
|
|
| '..' | '.'
|
|
path = locatedExpr(bookmark | pathstd | '*')('path')
|
|
parser = Optional(path) + Optional(command) + Optional(parameters)
|
|
self._parser = parser
|
|
|
|
if tty:
|
|
- readline.set_completer_delims('\t\n ~!#$^&(){}\|;\'",?')
|
|
+ readline.set_completer_delims('\t\n ~!#$^&(){}|;\'",?')
|
|
readline.set_completion_display_matches_hook(
|
|
self._display_completions)
|
|
|