mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Fix a number of incorrect escapes
Pointed out by newer versions of pep8, but they were never correct.
This commit is contained in:
@ -23,7 +23,7 @@ pagecount = 0
|
||||
quiet = False
|
||||
# regular expression used to search and extract the title on a given piece of
|
||||
# documentation, for further use in the application
|
||||
re_titlematch = re.compile('<title\s*>([^<]+)</title\s*>', re.IGNORECASE)
|
||||
re_titlematch = re.compile(r'<title\s*>([^<]+)</title\s*>', re.IGNORECASE)
|
||||
# regular expression used to find any images that are in the HTML and apply
|
||||
# additional bootstrap classes
|
||||
re_figure_match = re.compile('<div([^<>]+)class="figure"', re.IGNORECASE)
|
||||
|
@ -8,7 +8,7 @@ import requests
|
||||
from collections import defaultdict
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
re_platformdir = re.compile('^(\w+)-(\d+)-([^-]+)$')
|
||||
re_platformdir = re.compile(r'^(\w+)-(\d+)-([^-]+)$')
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Spider repo RPMs")
|
||||
|
@ -61,7 +61,7 @@ if __name__ == "__main__":
|
||||
print("Warnings: %s" % resp.headers['x-w3c-validator-warnings'])
|
||||
hp = html.parser.HTMLParser()
|
||||
for m in re.findall('<li class="msg_err">.*?</li>', resp.text, re.DOTALL):
|
||||
r = re.search('<em>Line <a href="[^"]+">(\d+)</a>.*<span class="msg">(.*?)</span>', m, re.DOTALL)
|
||||
r = re.search(r'<em>Line <a href="[^"]+">(\d+)</a>.*<span class="msg">(.*?)</span>', m, re.DOTALL)
|
||||
if r:
|
||||
print("Line %s (should be around %s): %s" % (r.group(1), int(r.group(1)) - firstline, hp.unescape(r.group(2))))
|
||||
r2 = re.search('<code class="input">(.*?)<strong title=".*?">(.*?)</strong>(.*?)</code>', m, re.DOTALL)
|
||||
|
Reference in New Issue
Block a user