Compare commits
No commits in common. "8b833eef0b4eb83e185579e47db73d3dc2a9b858" and "10612fefaeff59c00c2c68b16172ebeff8a827a9" have entirely different histories.
8b833eef0b
...
10612fefae
@ -59,7 +59,8 @@ def draw_placeholder_content(page: Page):
|
|||||||
100),
|
100),
|
||||||
font=font)
|
font=font)
|
||||||
draw.text(
|
draw.text(
|
||||||
(10, 10), f"Border: {page.border_size}px", fill=(
|
(10, 10), f"Border: {
|
||||||
|
page.border_size}px", fill=(
|
||||||
150, 150, 150), font=font)
|
150, 150, 150), font=font)
|
||||||
draw.text(
|
draw.text(
|
||||||
(content_x + 10,
|
(content_x + 10,
|
||||||
|
|||||||
@ -99,8 +99,8 @@ class Paragraph(Styleable, FontRegistry, Block):
|
|||||||
container.add_block(paragraph)
|
container.add_block(paragraph)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return paragraph
|
return paragraph
|
||||||
|
|
||||||
@ -251,8 +251,8 @@ class Heading(Paragraph):
|
|||||||
container.add_block(heading)
|
container.add_block(heading)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return heading
|
return heading
|
||||||
|
|
||||||
@ -313,8 +313,8 @@ class Quote(Block):
|
|||||||
container.add_block(quote)
|
container.add_block(quote)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return quote
|
return quote
|
||||||
|
|
||||||
@ -416,8 +416,8 @@ class CodeBlock(Block):
|
|||||||
container.add_block(code_block)
|
container.add_block(code_block)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return code_block
|
return code_block
|
||||||
|
|
||||||
@ -516,8 +516,8 @@ class HList(Block):
|
|||||||
container.add_block(hlist)
|
container.add_block(hlist)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return hlist
|
return hlist
|
||||||
|
|
||||||
@ -633,8 +633,8 @@ class ListItem(Block):
|
|||||||
container.add_item(item)
|
container.add_item(item)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_item' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_item' method")
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
@ -766,8 +766,8 @@ class TableCell(Block):
|
|||||||
container.add_cell(cell)
|
container.add_cell(cell)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_cell' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_cell' method")
|
||||||
|
|
||||||
return cell
|
return cell
|
||||||
|
|
||||||
@ -909,8 +909,8 @@ class TableRow(Block):
|
|||||||
container.add_row(row, section)
|
container.add_row(row, section)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_row' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_row' method")
|
||||||
|
|
||||||
return row
|
return row
|
||||||
|
|
||||||
@ -1025,8 +1025,8 @@ class Table(Block):
|
|||||||
container.add_block(table)
|
container.add_block(table)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return table
|
return table
|
||||||
|
|
||||||
@ -1193,8 +1193,8 @@ class Image(Block):
|
|||||||
container.add_block(image)
|
container.add_block(image)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return image
|
return image
|
||||||
|
|
||||||
@ -1567,8 +1567,8 @@ class HorizontalRule(Block):
|
|||||||
container.add_block(hr)
|
container.add_block(hr)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return hr
|
return hr
|
||||||
|
|
||||||
@ -1608,7 +1608,7 @@ class PageBreak(Block):
|
|||||||
container.add_block(page_break)
|
container.add_block(page_break)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {type(container).__name__} must have an 'add_block' method"
|
f"Container {
|
||||||
)
|
type(container).__name__} must have an 'add_block' method")
|
||||||
|
|
||||||
return page_break
|
return page_break
|
||||||
|
|||||||
@ -103,7 +103,8 @@ class RenderableImage(Renderable, Queriable):
|
|||||||
self._pil_image = PILImage.open(BytesIO(response.content))
|
self._pil_image = PILImage.open(BytesIO(response.content))
|
||||||
self._abstract_image._loaded_image = self._pil_image
|
self._abstract_image._loaded_image = self._pil_image
|
||||||
else:
|
else:
|
||||||
self._error_message = f"Failed to load image: HTTP status {response.status_code}"
|
self._error_message = f"Failed to load image: HTTP status {
|
||||||
|
response.status_code}"
|
||||||
except ImportError:
|
except ImportError:
|
||||||
self._error_message = "Requests library not available for URL loading"
|
self._error_message = "Requests library not available for URL loading"
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user