##// END OF EJS Templates
Fix more escape sequences
Matthias Bussonnier -
Show More
@@ -1592,7 +1592,7 b' class IPCompleter(Completer):'
1592 $
1592 $
1593 '''
1593 '''
1594 regexps = self.__dict_key_regexps = {
1594 regexps = self.__dict_key_regexps = {
1595 False: re.compile(dict_key_re_fmt % '''
1595 False: re.compile(dict_key_re_fmt % r'''
1596 # identifiers separated by .
1596 # identifiers separated by .
1597 (?!\d)\w+
1597 (?!\d)\w+
1598 (?:\.(?!\d)\w+)*
1598 (?:\.(?!\d)\w+)*
@@ -65,7 +65,7 b" ini_spaces_re = re.compile(r'^([ \\t\\r\\f\\v]+)')"
65
65
66 # regexp to match pure comment lines so we don't accidentally insert 'if 1:'
66 # regexp to match pure comment lines so we don't accidentally insert 'if 1:'
67 # before pure comments
67 # before pure comments
68 comment_line_re = re.compile('^\s*\#')
68 comment_line_re = re.compile(r'^\s*\#')
69
69
70
70
71 def num_ini_spaces(s):
71 def num_ini_spaces(s):
@@ -171,7 +171,7 b' class assemble_python_lines(TokenInputTransformer):'
171
171
172 @CoroutineInputTransformer.wrap
172 @CoroutineInputTransformer.wrap
173 def assemble_logical_lines():
173 def assemble_logical_lines():
174 """Join lines following explicit line continuations (\)"""
174 r"""Join lines following explicit line continuations (\)"""
175 line = ''
175 line = ''
176 while True:
176 while True:
177 line = (yield line)
177 line = (yield line)
@@ -361,7 +361,7 b' def cellmagic(end_on_blank_line=False):'
361 reset (sent None).
361 reset (sent None).
362 """
362 """
363 tpl = 'get_ipython().run_cell_magic(%r, %r, %r)'
363 tpl = 'get_ipython().run_cell_magic(%r, %r, %r)'
364 cellmagic_help_re = re.compile('%%\w+\?')
364 cellmagic_help_re = re.compile(r'%%\w+\?')
365 line = ''
365 line = ''
366 while True:
366 while True:
367 line = (yield line)
367 line = (yield line)
@@ -24,7 +24,7 b' from logging import error'
24 # Magic implementation classes
24 # Magic implementation classes
25 #-----------------------------------------------------------------------------
25 #-----------------------------------------------------------------------------
26
26
27 reg = re.compile('^\w+\.\w+$')
27 reg = re.compile(r'^\w+\.\w+$')
28 @magics_class
28 @magics_class
29 class ConfigMagics(Magics):
29 class ConfigMagics(Magics):
30
30
@@ -41,7 +41,7 b' from IPython.utils.encoding import get_stream_enc'
41 # ! and !! trigger if they are first char(s) *or* follow an indent
41 # ! and !! trigger if they are first char(s) *or* follow an indent
42 # ? triggers as first or last char.
42 # ? triggers as first or last char.
43
43
44 line_split = re.compile("""
44 line_split = re.compile(r"""
45 ^(\s*) # any leading space
45 ^(\s*) # any leading space
46 ([,;/%]|!!?|\?\??)? # escape character or characters
46 ([,;/%]|!!?|\?\??)? # escape character or characters
47 \s*(%{0,2}[\w\.\*]*) # function/method, possibly with leading %
47 \s*(%{0,2}[\w\.\*]*) # function/method, possibly with leading %
@@ -68,7 +68,7 b' def split_user_input(line, pattern=None):'
68 except ValueError:
68 except ValueError:
69 # print "split failed for line '%s'" % line
69 # print "split failed for line '%s'" % line
70 ifun, the_rest = line, u''
70 ifun, the_rest = line, u''
71 pre = re.match('^(\s*)(.*)',line).groups()[0]
71 pre = re.match(r'^(\s*)(.*)',line).groups()[0]
72 esc = ""
72 esc = ""
73 else:
73 else:
74 pre, esc, ifun, the_rest = match.groups()
74 pre, esc, ifun, the_rest = match.groups()
@@ -47,7 +47,7 b' from token import *'
47 from codecs import lookup, BOM_UTF8
47 from codecs import lookup, BOM_UTF8
48 import collections
48 import collections
49 from io import TextIOWrapper
49 from io import TextIOWrapper
50 cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
50 cookie_re = re.compile(r"coding[:=]\s*([-\w.]+)")
51
51
52 import token
52 import token
53 __all__ = token.__all__ + ["COMMENT", "tokenize", "detect_encoding",
53 __all__ = token.__all__ + ["COMMENT", "tokenize", "detect_encoding",
General Comments 0
You need to be logged in to leave comments. Login now