pep8 compliance: E261 at least two spaces before inline comment
This commit is contained in:
parent
b5a5deae57
commit
4cfb181af1
16
png.py
16
png.py
@ -167,7 +167,7 @@ from __future__ import generators
|
|||||||
__version__ = "$URL: http://pypng.googlecode.com/svn/trunk/code/png.py $ $Rev: 201 $"
|
__version__ = "$URL: http://pypng.googlecode.com/svn/trunk/code/png.py $ $Rev: 201 $"
|
||||||
|
|
||||||
from array import array
|
from array import array
|
||||||
try: # See :pyver:old
|
try: # See :pyver:old
|
||||||
import itertools
|
import itertools
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -314,7 +314,7 @@ class Writer:
|
|||||||
gamma=None,
|
gamma=None,
|
||||||
compression=None,
|
compression=None,
|
||||||
interlace=False,
|
interlace=False,
|
||||||
bytes_per_sample=None, # deprecated
|
bytes_per_sample=None, # deprecated
|
||||||
planes=None,
|
planes=None,
|
||||||
colormap=None,
|
colormap=None,
|
||||||
maxval=None,
|
maxval=None,
|
||||||
@ -1006,7 +1006,7 @@ def filter_scanline(type, line, fo, prev=None):
|
|||||||
ai += 1
|
ai += 1
|
||||||
def paeth():
|
def paeth():
|
||||||
# http://www.w3.org/TR/PNG/#9Filter-type-4-Paeth
|
# http://www.w3.org/TR/PNG/#9Filter-type-4-Paeth
|
||||||
ai = -fo # also used for ci
|
ai = -fo # also used for ci
|
||||||
for i, x in enumerate(line):
|
for i, x in enumerate(line):
|
||||||
a = 0
|
a = 0
|
||||||
b = prev[i]
|
b = prev[i]
|
||||||
@ -1033,11 +1033,11 @@ def filter_scanline(type, line, fo, prev=None):
|
|||||||
# of the image simpler. "up" becomes "none"; "paeth" becomes
|
# of the image simpler. "up" becomes "none"; "paeth" becomes
|
||||||
# "left" (non-trivial, but true). "average" needs to be handled
|
# "left" (non-trivial, but true). "average" needs to be handled
|
||||||
# specially.
|
# specially.
|
||||||
if type == 2: # "up"
|
if type == 2: # "up"
|
||||||
return line # type = 0
|
return line # type = 0
|
||||||
elif type == 3:
|
elif type == 3:
|
||||||
prev = [0] * len(line)
|
prev = [0] * len(line)
|
||||||
elif type == 4: # "paeth"
|
elif type == 4: # "paeth"
|
||||||
type = 1
|
type = 1
|
||||||
if type == 0:
|
if type == 0:
|
||||||
out.extend(line)
|
out.extend(line)
|
||||||
@ -1047,7 +1047,7 @@ def filter_scanline(type, line, fo, prev=None):
|
|||||||
up()
|
up()
|
||||||
elif type == 3:
|
elif type == 3:
|
||||||
average()
|
average()
|
||||||
else: # type == 4
|
else: # type == 4
|
||||||
paeth()
|
paeth()
|
||||||
return out
|
return out
|
||||||
|
|
||||||
@ -1786,7 +1786,7 @@ class Reader:
|
|||||||
row = group(row, planes)
|
row = group(row, planes)
|
||||||
opa = map(it.__ne__, row)
|
opa = map(it.__ne__, row)
|
||||||
opa = map(maxval.__mul__, opa)
|
opa = map(maxval.__mul__, opa)
|
||||||
opa = zip(opa) # convert to 1-tuples
|
opa = zip(opa) # convert to 1-tuples
|
||||||
yield array(typecode,
|
yield array(typecode,
|
||||||
itertools.chain(*map(operator.add, row, opa)))
|
itertools.chain(*map(operator.add, row, opa)))
|
||||||
pixels = itertrns(pixels)
|
pixels = itertrns(pixels)
|
||||||
|
Reference in New Issue
Block a user