1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 07:57:52 +03:00
This commit is contained in:
Guillaume Ayoub 2018-01-14 02:09:25 +01:00
parent 9d678ce942
commit ea9ffc9a3f
9 changed files with 9 additions and 12 deletions

View File

@ -12,10 +12,10 @@
import functools
import math
from urllib.parse import unquote, urljoin
import tinycss2
from tinycss2.color3 import parse_color
from urllib.parse import unquote, urljoin
from . import computed_values
from ..formatting_structure import counters

View File

@ -11,8 +11,8 @@ from collections import namedtuple
from itertools import cycle
from . import replaced
from .percentages import resolve_radii_percentages
from ..formatting_structure import boxes
from .percentages import resolve_radii_percentages
Background = namedtuple('Background', 'color, layers, image_rendering')
BackgroundLayer = namedtuple(

View File

@ -10,6 +10,7 @@
"""
def image_marker_layout(box):
"""Layout the :class:`boxes.ImageMarkerBox` ``box``.

View File

@ -13,7 +13,6 @@
import hashlib
import io
import mimetypes
import sys
import zlib
from urllib.parse import unquote

View File

@ -8,4 +8,3 @@
:license: BSD, see LICENSE for details.
"""

View File

@ -18,15 +18,15 @@ import sys
import threading
import unicodedata
import zlib
from urllib.parse import urlencode, urljoin, uses_relative
import cairocffi as cairo
import pytest
from pdfrw import PdfReader
from urllib.parse import urlencode, urljoin, uses_relative
from .. import CSS, HTML, __main__, default_url_fetcher, navigator
from ..urls import path2url
from .test_draw import image_to_pixels
from .test_draw import B, _, assert_pixels_equal, image_to_pixels, r
from .testing_utils import (
FakeHTML, assert_no_logs, capture_logs, http_server, resource_filename,
temp_directory)
@ -158,7 +158,6 @@ def test_css_parsing():
def check_png_pattern(png_bytes, x2=False, blank=False, rotated=False):
from .test_draw import _, r, B, assert_pixels_equal
if blank:
expected_pixels = [
_ + _ + _ + _ + _ + _ + _ + _,

View File

@ -115,7 +115,7 @@ def test_annotate_document():
assert p['margin_right'] == (0, 'px')
assert p['margin_bottom'] == (24, 'px')
assert p['margin_left'] == (0, 'px')
assert p['background_color'] == 'currentColor' # resolved at use-value time.
assert p['background_color'] == 'currentColor'
# 2em * 1.25ex = 2 * 20 * 1.25 * 0.8 = 40
# 2.5ex * 1.25ex = 2.5 * 0.8 * 20 * 1.25 * 0.8 = 40

View File

@ -10,7 +10,7 @@
"""
from .test_boxes import render_pages as parse
from .test_draw import assert_pixels
from .test_draw import B, _, assert_pixels, r
from .testing_utils import assert_no_logs, capture_logs, requires
@ -1523,7 +1523,6 @@ def test_table_row_height():
@assert_no_logs
@requires('cairo', '1.12')
def test_table_vertical_align():
from .test_draw import _, r, B
assert_pixels('table_vertical_align', 28, 10, [
r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r+r, # noqa
r+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+B+r, # noqa

View File

@ -21,8 +21,8 @@ import traceback
import zlib
from base64 import decodebytes
from gzip import GzipFile
from urllib.parse import urljoin, urlsplit, quote, unquote, unquote_to_bytes
from urllib.request import urlopen, Request, pathname2url
from urllib.parse import quote, unquote, urljoin, urlsplit
from urllib.request import Request, pathname2url, urlopen
from . import VERSION_STRING
from .logger import LOGGER