grim/hgwebplus

b5d44784e27b
Parents e6b801778490
Children ee0e13f9d407
make hgwebplus.py flake8 clean and fix a bytes error
--- a/src/hgwebplus.py Fri Apr 10 18:50:13 2020 -0500
+++ b/src/hgwebplus.py Fri Apr 10 19:00:48 2020 -0500
@@ -98,10 +98,10 @@
compatibility but adds a lot of new features. This is not directly
wrapped, but is instead called from _diffsgen below, which is wrapped.
- This version provides additional details about each file. The filenames
- are in filea, and fileb; The line number that's being displayed for both
- filea and fileb are in linea and lineb. And finally the revision of
- each file is available in reva and revb.
+ This version provides additional details about each file. The
+ filenames are in filea, and fileb; The line number that's being
+ displayed for both filea and fileb are in linea and lineb. And finally
+ the revision of each file is available in reva and revb.
"""
linea = 0
lineb = 0
@@ -113,7 +113,7 @@
showa = True
showb = True
- match = RE_DIFF.match(l)
+ match = RE_DIFF.match(l.decode('ascii'))
if match is not None:
ltype = b'difflineat'
groups = match.groups()
@@ -226,7 +226,7 @@
lines.extend(hunklines)
args = (lines, blockno, lineidprefix, filea, reva, fileb, revb)
- l = templateutil.mappedgenerator(_prettyprintdifflines, args)
+ prettylines = templateutil.mappedgenerator(_prettyprintdifflines, args)
changetype = b'modified'
if filea == b'/dev/null':
@@ -241,7 +241,7 @@
b'changetype': changetype,
b'filea': filea,
b'fileb': fileb,
- b'lines': l,
+ b'lines': prettylines,
b'parity': next(parity),
b'reva': reva,
b'revb': revb,