Commit 034ea986 authored by Julian Andres Klode's avatar Julian Andres Klode

Fix escaping in regular expressions and ignore some pep8 warnings

This makes pep8 work again.
parent e3d1420e
......@@ -1342,7 +1342,7 @@ class Package(object):
changelog_file = urlopen(uri)
# do only get the lines that are new
changelog = u""
regexp = "^%s \((.*)\)(.*)$" % (re.escape(src_pkg))
regexp = "^%s \\((.*)\\)(.*)$" % (re.escape(src_pkg))
while True:
# Check if the download was canceled
if cancel_lock and cancel_lock.is_set():
......
......@@ -278,7 +278,7 @@ class InstallProgress(object):
if status == 'pmerror' or status == 'error':
self.error(pkgname, status_str)
elif status == 'conffile-prompt' or status == 'pmconffile':
match = re.match("\s*\'(.*)\'\s*\'(.*)\'.*", status_str)
match = re.match("\\s*\'(.*)\'\\s*\'(.*)\'.*", status_str)
if match:
self.conffile(match.group(1), match.group(2))
elif status == "pmstatus":
......
......@@ -145,7 +145,7 @@ class Repository(object):
def split_url(url):
''' split a given URL into the protocoll, the hostname and the dir part '''
split = re.split(":*\/+", url, maxsplit=2)
split = re.split(":*\\/+", url, maxsplit=2)
while len(split) < 3:
split.append(None)
return split
......
......@@ -20,7 +20,9 @@ class PackagePep8TestCase(unittest.TestCase):
# next logical line
# E265 block comment should start with '# '
# E402 module level import not at top of file (breaks tests)
"--ignore=E125,E126,E127,E128,E129,E265,E402",
# W504 line break after binary operator (that's the
# correct behavior)
"--ignore=E125,E126,E127,E128,E129,E265,E402,W504",
"--exclude", "build,tests/old",
"--repeat", py_dir])
if res != 0:
......
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