Skip to content

Commit

Permalink
[skip ci]: black/isort
Browse files Browse the repository at this point in the history
  • Loading branch information
black-isort-bot committed Feb 13, 2024
1 parent 0dda421 commit ee2e15d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions PyPDFForm/core/coordinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from reportlab.pdfbase.pdfmetrics import stringWidth

from ..middleware.text import Text
from .constants import (ANNOTATION_RECTANGLE_KEY, COORDINATE_GRID_FONT_SIZE_MARGIN_RATIO,
DEFAULT_FONT)
from .constants import (ANNOTATION_RECTANGLE_KEY,
COORDINATE_GRID_FONT_SIZE_MARGIN_RATIO, DEFAULT_FONT)
from .template import (get_char_rect_width, get_widget_alignment,
is_text_multiline)
from .utils import stream_to_io
Expand Down Expand Up @@ -158,7 +158,9 @@ def get_text_line_x_coordinates(
return None


def generate_coordinate_grid(pdf: bytes, color: Tuple[float, float, float], margin: float) -> bytes:
def generate_coordinate_grid(
pdf: bytes, color: Tuple[float, float, float], margin: float
) -> bytes:
"""Creates a grid view for the coordinates of a PDF."""

pdf_file = PdfReader(stream_to_io(pdf))
Expand Down
4 changes: 3 additions & 1 deletion tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@ def test_generate_coordinate_grid(template_stream, pdf_samples, request):


def test_generate_coordinate_grid_margin_50(template_stream, pdf_samples, request):
expected_path = os.path.join(pdf_samples, "test_generate_coordinate_grid_margin_50.pdf")
expected_path = os.path.join(
pdf_samples, "test_generate_coordinate_grid_margin_50.pdf"
)
with open(expected_path, "rb+") as f:
obj = PdfWrapper(template_stream).generate_coordinate_grid((1, 0, 1), margin=50)

Expand Down

0 comments on commit ee2e15d

Please sign in to comment.