Commit d19b4a85 authored by Nsukami Patrick's avatar Nsukami Patrick
Browse files

Fix DeprecationWarning: invalid escape sequence

parent 3aa0c203747c
......@@ -205,7 +205,7 @@ def configuration_cls(name):
def possible_configurations(directory):
"""return a list of installed configurations in a directory
according to \*-ctl files
according to *-ctl files
"""
return [name for name in ('repository', 'all-in-one', 'pyramid')
if exists(join(directory, '%s.conf' % name))]
......@@ -1149,7 +1149,7 @@ the repository',
"""return available translation for an instance, by looking for
compiled catalog
take \*args to be usable as a vocabulary method
take *args to be usable as a vocabulary method
"""
from glob import glob
yield 'en' # ensure 'en' is yielded even if no .mo found
......
......@@ -786,7 +786,7 @@ class ExamineLogCommand(Command):
continue
try:
rql, time = line.split('--')
rql = re.sub("(\'\w+': \d*)", '', rql)
rql = re.sub(r"(\'\w+': \d*)", '', rql)
if '{' in rql:
rql = rql[:rql.index('{')]
req = requests.setdefault(rql, [])
......
......@@ -101,10 +101,10 @@ def copy_file(stream, target, maxread=-1, buffer_size=2*16):
##############################################################################
_special = re.escape('()<>@,;:\\"/[]?={} \t')
_re_special = re.compile('[%s]' % _special)
_re_special = re.compile(r'[%s]' % _special)
_qstr = '"(?:\\\\.|[^"])*"' # Quoted string
_value = '(?:[^%s]+|%s)' % (_special, _qstr) # Save or quoted string
_option = '(?:;|^)\s*([^%s]+)\s*=\s*(%s)' % (_special, _value)
_option = r'(?:;|^)\s*([^%s]+)\s*=\s*(%s)' % (_special, _value)
_re_option = re.compile(_option) # key=value part of an Content-Type like header
def header_quote(val):
......
......@@ -439,7 +439,7 @@ class match_rtype(ExpectedValuePredicate):
named parameters `frometypes` and `toetypes` can be used to restrict
target subject and/or object entity types of the relation.
:param \*expected: possible relation types
:param *expected: possible relation types
:param frometypes: candidate entity types as subject of relation
:param toetypes: candidate entity types as object of relation
"""
......
......@@ -121,7 +121,7 @@ def last_modified(self):
"""return the date/time where this view should be considered as
modified. Take care of possible related objects modifications.
/!\ must return GMT time /!\
/!\\ must return GMT time /!\\
"""
# XXX check view module's file modification time in dev mod ?
ctime = datetime.utcnow()
......
......@@ -47,7 +47,7 @@ class PropertySheet(dict):
self.reset()
context['sheet'] = self
context['lazystr'] = self.lazystr
self._percent_rgx = re.compile('%(?!\()')
self._percent_rgx = re.compile(r'%(?!\()')
def lazystr(self, str):
return lazystr(str, self)
......
......@@ -96,7 +96,7 @@ def translate_rql_tree(rqlst, translations, schema):
def resolve_ambiguities(var_types, ambiguous_nodes, schema):
"""Tries to resolve remaining ambiguities for translation
/!\ An ambiguity is when two different string can be localized with
/!\\ An ambiguity is when two different string can be localized with
the same string
A simple example:
- 'name' in a company context will be localized as 'nom' in French
......
......@@ -87,7 +87,7 @@ class CubicWebWsgiRequest(CubicWebRequestBase):
# robust against potentially malformed input.
form = pformat(self.form)
meta = pformat(self.environ)
return '<CubicWebWsgiRequest\FORM:%s,\nMETA:%s>' % \
return '<CubicWebWsgiRequest\nFORM:%s,\nMETA:%s>' % \
(form, meta)
## cubicweb request interface ################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment