Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/paperpi/plugins/newyorker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Try it without a screen: `uv run paperpi render newyorker` (sample cartoon), or

## The cartoons

The cartoons and captions belong to The New Yorker and their cartoonists (© Condé Nast). PaperPi only downloads them to show on your own screen and does not share them. The sample cartoon, [`sample/island.png`](sample/island.png), its caption and its cartoonist ("Rosa Paperwhite") are made up: the drawing was made for this plugin with a short Pillow script (Pillow is the picture library PaperPi uses) and is under PaperPi's licence.
The cartoons and captions belong to The New Yorker and their cartoonists (© Condé Nast). PaperPi only downloads them to show on your own screen and does not share them. The sample cartoon, [`sample/therapist.png`](sample/therapist.png), its caption and its cartoonist ("Chatwell Gilbert Pennington Thurston (C.G.P.T.)") are made up: the drawing was made for PaperPi with an AI image tool and is under PaperPi's licence. It is stored in 16 shades of gray (the most a PaperPi screen shows), which keeps the file small.

## Sample images

Expand Down
9 changes: 5 additions & 4 deletions src/paperpi/plugins/newyorker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
PAGE_BYTES = PICTURE_BYTES = 2_000_000
FEED_SECONDS, PICTURE_SECONDS, PAGE_SECONDS = 20, 15, 10
NEW_YORK = "America/New_York"
SAMPLE = Path(__file__).parent / "sample" / "island.png"
SAMPLE = Path(__file__).parent / "sample" / "therapist.png"


class Settings(PluginSettings):
Expand Down Expand Up @@ -354,11 +354,12 @@ def draw(cartoon: Cartoon, context: Context) -> dict:
layouts=LAYOUTS,
fetch=fetch,
draw=draw,
# A made-up cartoon, caption and cartoonist, drawn for PaperPi: not a New Yorker cartoon.
# A made-up cartoon, caption and cartoonist, made for PaperPi: not a New Yorker cartoon.
sample=Cartoon(
Texts(
"“Finally, a place where the news arrives only once a week.”",
"Cartoon by Rosa Paperwhite",
"“You keep saying you want to be more spontaneous, but have you considered that "
"spontaneity might be the problem?”",
"Cartoon by Chatwell Gilbert Pennington Thurston (C.G.P.T.)",
"Monday, October 5",
),
SAMPLE,
Expand Down
Binary file removed src/paperpi/plugins/newyorker/sample/island.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_caption-5in65.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_caption-7in5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_caption-9in7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_caption_date-5in65.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_caption_date-7in5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_caption_date-9in7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_only-5in65.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_only-7in5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/images/newyorker-comic_only-9in7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/test_newyorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def test_hostile_id_keeps_files_in_storage(tmp_path, monkeypatch, pick):
def test_draw_gives_only_the_layouts_blocks(tmp_path, layout, blocks):
values = newyorker.draw(PLUGIN.sample, context(tmp_path, layout))
assert set(values) == blocks
assert values["comic"].size == (800, 800)
assert values["comic"].size == (1000, 789)
assert values.get("date", "Monday, October 5") == "Monday, October 5"


Expand Down
Loading