Fix flake8 W605 invalid escape sequence
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Tue, 13 Nov 2018 16:53:07 +0100
changeset 373 5cf657e6d8ac
parent 372 fa1c146aead2
child 374 2dfdaf654cc7
Fix flake8 W605 invalid escape sequence
cubicweb_blog/views/urlpublishing.py
--- a/cubicweb_blog/views/urlpublishing.py	Sun Nov 11 20:39:44 2018 +0000
+++ b/cubicweb_blog/views/urlpublishing.py	Tue Nov 13 16:53:07 2018 +0100
@@ -4,20 +4,20 @@
 class BlogReqRewriter(SimpleReqRewriter):
     rules = [
         # links generated by archives by date/author boxes
-        (rgx('/(micro)?blog/([0-9]+)/blogentries'),
+        (rgx(r'/(micro)?blog/([0-9]+)/blogentries'),
          dict(rql='Any B,BD ORDERBY BD DESC WHERE B creation_date BD, '
                   'B entry_of BL, BL eid %(eid)s' % {'eid': r'\2'},
               )),
-        (rgx('/(micro)?blog/([0-9]+)/blogentries/([a-z_]+)'),
+        (rgx(r'/(micro)?blog/([0-9]+)/blogentries/([a-z_]+)'),
          dict(rql='Any B,BD ORDERBY BD DESC WHERE B creation_date BD, '
                   'B entry_of BL, BL eid %(eid)s, '
                   'B created_by U, U login "%(user)s"' % {'eid': r'\2', 'user': r'\3'},
               user=r'\2')),
-        (rgx('/(micro)?blog/([0-9]+)/blogentries/([0-9]{4})'),
+        (rgx(r'/(micro)?blog/([0-9]+)/blogentries/([0-9]{4})'),
          dict(rql='Any B,BD ORDERBY BD DESC WHERE B creation_date BD, B entry_of BL, BL eid %(eid)s'
               'HAVING YEAR(BD)= %(year)s' % {'eid': r'\2', 'year': r'\3'},
               )),
-        (rgx('/(micro)?blog/([0-9]+)/blogentries/([0-9]{4})/([0-9]{2})'),
+        (rgx(r'/(micro)?blog/([0-9]+)/blogentries/([0-9]{4})/([0-9]{2})'),
          dict(rql='Any B,BD ORDERBY BD DESC WHERE B creation_date BD, '
                   'B entry_of BL, BL eid %(eid)s '
                   'HAVING YEAR(BD)= %(year)s, MONTH(BD)=%(month)s' % {'eid': r'\2',
@@ -26,20 +26,20 @@
               )),
 
         # XXX use or kill
-        (rgx('/blogentry/([a-z_]+)'),
+        (rgx(r'/blogentry/([a-z_]+)'),
          dict(rql='Any B,BD ORDERBY BD DESC WHERE B is BlogEntry, '
                   'B creation_date BD, B created_by U, U login "%(user)s"' % {'user': r'\1'},
               user=r'\1')),
-        (rgx('/blogentry/([a-z_]+)\.rss'),
+        (rgx(r'/blogentry/([a-z_]+)\.rss'),
          dict(rql='Any B,BD ORDERBY BD DESC LIMIT 20 WHERE B is BlogEntry, '
                   'B creation_date BD, B created_by U, U login "%(user)s"' % {'user': r'\1'},
               vid='rss')),
 
 
-        (rgx('/blogentries/([0-9]{4})'),
+        (rgx(r'/blogentries/([0-9]{4})'),
          dict(rql='Any B,BD ORDERBY BD DESC WHERE B is BlogEntry, B creation_date BD '
                   'HAVING YEAR(BD) = %(year)s' % {'year': r'\1'})),
-        (rgx('/blogentries/([0-9]{4})/([0-9]{2})'),
+        (rgx(r'/blogentries/([0-9]{4})/([0-9]{2})'),
          dict(rql='Any B,BD ORDERBY BD DESC WHERE B is BlogEntry, B creation_date BD '
                   'HAVING YEAR(BD) = %(year)s, MONTH(BD) = %(month)s' % {'year': r'\1',
                                                                          'month': r'\2'})),