Skip to content

Commit a0476c9

Browse files
committed
STY: More travis pep8 fixes
1 parent 9e6cf4f commit a0476c9

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

lib/matplotlib/backends/backend_pdf.py

+13-16
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ def __init__(self, filename):
462462
self.fontNames = {} # maps filenames to internal font names
463463
self.nextFont = 1 # next free internal font name
464464
self.dviFontInfo = {} # information on dvi fonts
465-
self.type1Descriptors = {} # differently encoded Type-1 fonts may
466-
# share the same descriptor
465+
# differently encoded Type-1 fonts may share the same descriptor
466+
self.type1Descriptors = {}
467467
self.used_characters = {}
468468

469469
self.alphaStates = {} # maps alpha values to graphics state objects
@@ -480,8 +480,7 @@ def __init__(self, filename):
480480

481481
self.paths = []
482482

483-
self.pageAnnotations = [] # A list of annotations for the
484-
# current page
483+
self.pageAnnotations = [] # A list of annotations for the current page
485484

486485
# The PDF spec recommends to include every procset
487486
procsets = [Name(x)
@@ -769,7 +768,7 @@ def createType1Descriptor(self, t1font, fontfile):
769768
'FontFamily': t1font.prop['FamilyName'],
770769
'StemV': 50, # TODO
771770
# (see also revision 3874; but not all TeX distros have AFM files!)
772-
#'FontWeight': a number where 400 = Regular, 700 = Bold
771+
# 'FontWeight': a number where 400 = Regular, 700 = Bold
773772
}
774773

775774
self.writeObject(fontdescObject, descriptor)
@@ -1251,8 +1250,8 @@ def imageObject(self, image):
12511250
self.images[image] = (name, ob)
12521251
return name
12531252

1254-
## These two from backend_ps.py
1255-
## TODO: alpha (SMask, p. 518 of pdf spec)
1253+
# These two from backend_ps.py
1254+
# TODO: alpha (SMask, p. 518 of pdf spec)
12561255

12571256
def _rgb(self, im):
12581257
h, w, s = im.as_rgba_str()
@@ -1710,10 +1709,8 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans,
17101709
simplify=False):
17111710
if len(vertices):
17121711
x, y = vertices[-2:]
1713-
if (x < 0 or
1714-
y < 0 or
1715-
x > self.file.width * 72 or
1716-
y > self.file.height * 72):
1712+
if (x < 0 or y < 0 or
1713+
x > self.file.width * 72 or y > self.file.height * 72):
17171714
continue
17181715
dx, dy = x - lastx, y - lasty
17191716
output(1, 0, 0, 1, dx, dy, Op.concat_matrix,
@@ -1970,8 +1967,8 @@ def check_simple_method(s):
19701967
chunks[-1][1].append(c)
19711968
else:
19721969
chunks.append((char_type, [c]))
1973-
use_simple_method = (len(chunks) == 1
1974-
and chunks[-1][0] == 1)
1970+
use_simple_method = (len(chunks) == 1 and
1971+
chunks[-1][0] == 1)
19751972
return use_simple_method, chunks
19761973

19771974
def draw_text_simple():
@@ -2255,7 +2252,7 @@ def clip_cmd(self, cliprect, clippath):
22552252
cmds.extend(self.pop())
22562253
# Unless we hit the right one, set the clip polygon
22572254
if ((self._cliprect, self._clippath) != (cliprect, clippath) or
2258-
self.parent is None):
2255+
self.parent is None):
22592256
cmds.extend(self.push())
22602257
if self._cliprect != cliprect:
22612258
cmds.extend([cliprect, Op.rectangle, Op.clip, Op.endpath])
@@ -2417,8 +2414,8 @@ def close(self):
24172414
PDF file.
24182415
"""
24192416
self._file.close()
2420-
if (self.get_pagecount() == 0 and not self.keep_empty
2421-
and not self._file.passed_in_file_object):
2417+
if (self.get_pagecount() == 0 and not self.keep_empty and
2418+
not self._file.passed_in_file_object):
24222419
os.remove(self._file.fh.name)
24232420
self._file = None
24242421

lib/matplotlib/tests/test_pickle.py

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def recursive_pickle(top_obj):
8383
objs = sorted(six.itervalues(objs), key=lambda val: (-val[0], val[2]))
8484

8585
for _, obj, location in objs:
86-
# print('trying %s' % location)
8786
try:
8887
pickle.dump(obj, BytesIO(), pickle.HIGHEST_PROTOCOL)
8988
except Exception as err:

0 commit comments

Comments
 (0)