Repository navigation
Editing plugin blocks in the config file (M5 part 2b-1) - #244
Merged
Merged
Conversation
Plugins can mark a setting as required with paperpi.plugin.setting(..., required=True). A switched-on plugin that is missing one is not shown and not counted as broken; the config check warns and paperpi list shows "needs <settings>". met_no and moon_phase require lat, lon and email (met.no's terms of service ask for a real email address); the example config no longer fills in a made-up address. Part of #238 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #238. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
# Conflicts: # src/paperpi/plugins/default/README.md # src/paperpi/plugins/default/__init__.py # src/paperpi/scheduler.py
4 tasks done
…ettings # Conflicts: # src/paperpi/plugins/splash_screen/README.md # src/paperpi/scheduler.py
txoof
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #238 (M5 part 2b-1). Built on #241 (part 2a): merge #241 first; this PR then moves to
mainby itself.What changed
The code the web interface uses to change
[[plugin]]blocks in the config file. The pages that use it come in part 2b-2 (next PR).src/paperpi/web/config_file.py: move a block up or down, remove it, switch it on or off, add a new one at the end of the plugin list.[[plugin]]line as part of the block before it, so they would move with the wrong plugin. Here those comments (when a blank line is above them) belong to the block below them, move with it, and are removed with it.save_password_hash) now uses the same read, save and lock, so a password change and a plugin change at the same moment can't undo each other.\n, like TOML (Python'ssplitlines()also splits at U+2028 and others). Windows line endings are kept. Plugin names now also refuse U+0085, U+2028 and U+2029, which Python counts as line breaks. The config check's line numbers use the same rule.docs/decisions/config-format.md: note on why plugin blocks are changed as text.Choices I made without asking:
enabled =is lost when a plugin is switched on or off (switching on removes the line, since the file only holds non-defaults).Area
web (
src/paperpi/web/), core (src/paperpi/plugin.pyname check,src/paperpi/config.pyline numbers), docs.Tests
New
tests/test_web_config_file.py(16 tests): comments move with their block,[plugin.x]parts move too, other parts ([web]) stay, edge of the list, changed meanwhile, unusual headers refused,enabledinside a string or a[plugin.x]part is not the switch, Windows line endings, no last line break, U+2028 inside values, size limit, permissions. Name check test intests/test_example.py.uv run pytestpasses (1139 tests on this branch)uv run ruff check .passesReview
Only txoof approves and merges this PR.
🤖 Generated with Claude Code