Remove unused @public template-global registration (url_quote, get_borrow_status) (#13422) - #13427
Merged
RayBB merged 1 commit intoAug 25, 2026
Conversation
β¦ get_borrow_status (internetarchive#13422) url_quote (openlibrary/plugins/upstream/utils.py) and get_borrow_status (openlibrary/plugins/upstream/borrow.py) are registered as Templetor template globals via the infogami @public decorator, but no template references either. Remove the @public decorator from both, keeping the functions. Both are used only via direct calls / module-attribute access, so de-registering them as template globals is safe: - url_quote: called internally in utils.py (set_share_links) and tested via utils.url_quote(...) in tests/test_utils.py - get_borrow_status: called internally in borrow.py (ia_loan_status) Verified by grepping .py/.html/.js/.md across the repo: zero template/JS references to either name. The `public` import stays used in both files (other @public decorators remain), so no import is orphaned.
12 tasks
RayBB
approved these changes
Aug 25, 2026
RayBB
left a comment
Collaborator
There was a problem hiding this comment.
Good work here. Thanks!
Put it on testing and double checked it and it works.
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 #13422 β the "Remove the
@publicdecorator only (keep the function)" section.What
url_quote(openlibrary/plugins/upstream/utils.py) andget_borrow_status(openlibrary/plugins/upstream/borrow.py) are exposed as Templetor template globals via the infogami@publicdecorator, but no template uses them. This removes the@publicdecorator from both. The functions stay β only their template-global registration is dropped.Why it's safe
.py,.html,.js, and.mdacross the repo; neither name is referenced as a template global anywhere.@public:url_quoteβ called internally inutils.py(set_share_linkscallsurl_quote(...)), and tested viautils.url_quote(...)inopenlibrary/plugins/upstream/tests/test_utils.py.get_borrow_statusβ called internally inborrow.py(ia_loan_status).@publicdecorators (utils.py has 33, borrow.py has 2 more), so thepublicimport stays used; no new lint error (the pre-existingI001import-sort notices in these files are untouched by this change).Verification
.py/.html/.js) β done, zero references outside the registration.make test-py-uv) β I don't have the full Docker environment locally (the import chain needsinfogami), so I couldn't run these here. Flagging for a reviewer to confirm in CI.Scoped to just this one section per the "one PR per section" guidance. (My other section β
helpers.py __all__β is #13426.)