Skip to content

Commit bc5189b

Browse files
authored
Pleasing black (#1354)
1 parent e20cc78 commit bc5189b

File tree

10 files changed

+28
-20
lines changed

10 files changed

+28
-20
lines changed

fpdf/annotations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def __init__(self, *args, **kwargs):
8484

8585
class AnnotationDict(AnnotationMixin):
8686
"A PDF annotation that get serialized as an inline <<dictionnary>>"
87+
8788
__slots__ = ( # RAM usage optimization
8889
"type",
8990
"subtype",

fpdf/enums.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def coerce(cls, value):
149149

150150
class WrapMode(CoerciveEnum):
151151
"Defines how to break and wrap lines in multi-line text."
152+
152153
WORD = intern("WORD")
153154
"Wrap by word"
154155

@@ -158,6 +159,7 @@ class WrapMode(CoerciveEnum):
158159

159160
class CharVPos(CoerciveEnum):
160161
"Defines the vertical position of text relative to the line."
162+
161163
SUP = intern("SUP")
162164
"Superscript"
163165

@@ -493,6 +495,7 @@ def coerce(cls, value):
493495

494496
class TextMode(CoerciveIntEnum):
495497
"Values described in PDF spec section 'Text Rendering Mode'"
498+
496499
FILL = 0
497500
STROKE = 1
498501
FILL_STROKE = 2
@@ -552,6 +555,7 @@ class YPos(CoerciveEnum):
552555

553556
class Angle(CoerciveIntEnum):
554557
"Direction values used for mirror transformations specifying the angle of mirror line"
558+
555559
NORTH = 90
556560
EAST = 0
557561
SOUTH = 270

fpdf/fpdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ def wrapper(self, *args, **kwargs):
221221

222222
class FPDF(GraphicsStateMixin, TextRegionMixin):
223223
"PDF Generation class"
224+
224225
MARKDOWN_BOLD_MARKER = "**"
225226
MARKDOWN_ITALICS_MARKER = "__"
226227
MARKDOWN_UNDERLINE_MARKER = "--"

fpdf/image_datastructures.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def size_in_document_units(self, w, h, scale=1):
6565

6666
class VectorImageInfo(ImageInfo):
6767
"Information about a vector image used in the PDF document"
68+
6869
# pass
6970

7071

fpdf/line_break.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"\u2006", # | SIX-PER-EM SPACE
3232
"\u2008", # | PUNCTUATION SPACE
3333
"\u2009", # | THIN SPACE
34-
"\u200A", # | HAIR SPACE
35-
"\u205F", # | MEDIUM MATHEMATICAL SPACE
34+
"\u200a", # | HAIR SPACE
35+
"\u205f", # | MEDIUM MATHEMATICAL SPACE
3636
"\u3000", # | IDEOGRAPHIC SPACE
3737
"\u0009", # | TAB
3838
]

fpdf/table.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ def cell(
855855
@dataclass(frozen=True)
856856
class Cell:
857857
"Internal representation of a table cell"
858+
858859
__slots__ = ( # RAM usage optimization
859860
"text",
860861
"align",

scripts/benchmark_borb_vs_fpdf2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
"""Speed benchmark: how much time each lib takes to generate a 10 thousands pages PDF with ~180 distinct images?
3-
(disclaimer: the author of this benchmark is fpdf2 current maintainer)"""
3+
(disclaimer: the author of this benchmark is fpdf2 current maintainer)"""
44
# Script used in this article: https://chezsoi.org/lucas/blog/fpdf2-5-2-svg-support-and-borb.html
55
import resource
66
from decimal import Decimal

test/fonts/test_wraps_zerowidthspace.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ def test_wraps_zerowidthspace(tmp_path):
1515
pdf.write(
1616
8,
1717
"Thai (ideally wouldn't wrap after the space after '1000'): "
18-
+ "นโยบาย\u200Bสาธารณะ\u200Bมี\u200Bความ\u200Bสำคัญ\u200Bต่อ\u200B"
19-
+ "การ\u200Bสนับสนุน\u200Bการ\u200Bออก\u200Bแบบ\u200Bและ\u200Bการ"
20-
+ "\u200Bสร้าง\u200Bชุมชน\u200Bและ\u200Bเมือง\u200Bสุขภาพ\u200Bดี\u200B"
21-
+ "และ\u200Bยั่งยืน รายการ\u200Bตรวจ\u200Bสอบนโยบาย\u200Bความ\u200B"
22-
+ "ท้าทาย 1,000 เมือง\u200Bสำหรับ\u200Bใช้\u200Bเพื่อ\u200Bประเมิน\u200Bการ"
23-
+ "\u200Bมี\u200Bอยู่\u200Bและ\u200Bคุณภาพ\u200Bของ\u200Bนโยบาย\u200Bที่"
24-
+ "\u200Bสอด\u200Bคล้อง\u200Bกับ\u200Bหลัก\u200Bฐาน\u200Bและ\u200Bหลัก"
25-
+ "\u200Bการ\u200Bสำหรับ\u200Bเมือง\u200Bที่\u200Bมี\u200Bสุขภาพ\u200Bดี"
26-
+ "\u200Bและ\u200Bยั่งยืน",
18+
+ "นโยบาย\u200bสาธารณะ\u200bมี\u200bความ\u200bสำคัญ\u200bต่อ\u200b"
19+
+ "การ\u200bสนับสนุน\u200bการ\u200bออก\u200bแบบ\u200bและ\u200bการ"
20+
+ "\u200bสร้าง\u200bชุมชน\u200bและ\u200bเมือง\u200bสุขภาพ\u200bดี\u200b"
21+
+ "และ\u200bยั่งยืน รายการ\u200bตรวจ\u200bสอบนโยบาย\u200bความ\u200b"
22+
+ "ท้าทาย 1,000 เมือง\u200bสำหรับ\u200bใช้\u200bเพื่อ\u200bประเมิน\u200bการ"
23+
+ "\u200bมี\u200bอยู่\u200bและ\u200bคุณภาพ\u200bของ\u200bนโยบาย\u200bที่"
24+
+ "\u200bสอด\u200bคล้อง\u200bกับ\u200bหลัก\u200bฐาน\u200bและ\u200bหลัก"
25+
+ "\u200bการ\u200bสำหรับ\u200bเมือง\u200bที่\u200bมี\u200bสุขภาพ\u200bดี"
26+
+ "\u200bและ\u200bยั่งยืน",
2727
)
2828
assert_pdf_equal(pdf, HERE / "thai_wraps_zerowidthspace.pdf", tmp_path)

test/test_positioning.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
""" Tests related to positioning self.x and self.y on the page.
2-
implemented:
3-
* ln()
4-
to be implemented:
5-
* set_x()
6-
* set_y()
7-
* set_xy()
1+
"""Tests related to positioning self.x and self.y on the page.
2+
implemented:
3+
* ln()
4+
to be implemented:
5+
* set_x()
6+
* set_y()
7+
* set_xy()
88
"""
99

1010
from pathlib import Path

test/text/test_varied_fragments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Test that _render_styled_text_line() correctly handles sequences of
1+
"""Test that _render_styled_text_line() correctly handles sequences of
22
Fragments with varying font/size/style and other characteristics.
33
"""
44

0 commit comments

Comments
 (0)