mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
pep8
This commit is contained in:
parent
9c5d2646e3
commit
80887a8a14
@ -108,7 +108,7 @@ class PdfEngine(QPaintEngine):
|
|||||||
|
|
||||||
def init_page(self):
|
def init_page(self):
|
||||||
self.pdf.transform(self.pdf_system)
|
self.pdf.transform(self.pdf_system)
|
||||||
self.pdf.apply_fill(color=(1, 1, 1)) # QPainter has a default background brush of white
|
self.pdf.apply_fill(color=(1, 1, 1)) # QPainter has a default background brush of white
|
||||||
self.graphics.reset()
|
self.graphics.reset()
|
||||||
self.pdf.save_stack()
|
self.pdf.save_stack()
|
||||||
self.current_page_inited = True
|
self.current_page_inited = True
|
||||||
@ -150,7 +150,8 @@ class PdfEngine(QPaintEngine):
|
|||||||
return QPaintEngine.Pdf
|
return QPaintEngine.Pdf
|
||||||
|
|
||||||
def add_image(self, img, cache_key):
|
def add_image(self, img, cache_key):
|
||||||
if img.isNull(): return
|
if img.isNull():
|
||||||
|
return
|
||||||
return self.pdf.add_image(img, cache_key)
|
return self.pdf.add_image(img, cache_key)
|
||||||
|
|
||||||
@store_error
|
@store_error
|
||||||
@ -271,7 +272,8 @@ class PdfEngine(QPaintEngine):
|
|||||||
@store_error
|
@store_error
|
||||||
def drawPolygon(self, points, mode):
|
def drawPolygon(self, points, mode):
|
||||||
self.apply_graphics_state()
|
self.apply_graphics_state()
|
||||||
if not points: return
|
if not points:
|
||||||
|
return
|
||||||
p = Path()
|
p = Path()
|
||||||
p.move_to(points[0].x(), points[0].y())
|
p.move_to(points[0].x(), points[0].y())
|
||||||
for point in points[1:]:
|
for point in points[1:]:
|
||||||
@ -303,8 +305,7 @@ class PdfEngine(QPaintEngine):
|
|||||||
link.append((llx, lly, urx, ury))
|
link.append((llx, lly, urx, ury))
|
||||||
self.pdf.links.add(current_item, start_page, links, anchors)
|
self.pdf.links.add(current_item, start_page, links, anchors)
|
||||||
|
|
||||||
class PdfDevice(QPaintDevice): # {{{
|
class PdfDevice(QPaintDevice): # {{{
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, file_object, page_size=A4, left_margin=inch,
|
def __init__(self, file_object, page_size=A4, left_margin=inch,
|
||||||
top_margin=inch, right_margin=inch, bottom_margin=inch,
|
top_margin=inch, right_margin=inch, bottom_margin=inch,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user