-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Needs: BreakdownThis big issue needs a checklist or subissues to describe a breakdown of work. [managed]This big issue needs a checklist or subissues to describe a breakdown of work. [managed]Needs: LeadNeeds: TriageThis issue needs triage. The team needs to decide who should own it, what to do, by when. [managed]This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed]Type: BugSomething isn't working. [managed]Something isn't working. [managed]
Description
Problem
@cdrini mentioned here that this code is very challenging to read and a bit too magical we should simplify it if we can, especially as we have to keep digging deeper into web.py for the fastapi migration.
openlibrary/openlibrary/code.py
Lines 16 to 45 in 7ac77b5
| old_plugins = [ | |
| "openlibrary", | |
| "worksearch", | |
| "inside", | |
| "books", | |
| "admin", | |
| "upstream", | |
| "importapi", | |
| ] | |
| def setup(): | |
| setup_logging() | |
| logger = logging.getLogger("openlibrary") | |
| logger.info("Application init") | |
| for p in old_plugins: | |
| logger.info("loading plugin %s", p) | |
| modname = f"openlibrary.plugins.{p}.code" | |
| path = "openlibrary/plugins/" + p | |
| template.load_templates(path, lazy=True) | |
| macro.load_macros(path, lazy=True) | |
| i18n.load_strings(path) | |
| __import__(modname, globals(), locals(), ['plugins']) | |
| delegate.plugins += [ | |
| delegate._make_plugin_module('openlibrary.plugins.' + name) | |
| for name in old_plugins | |
| ] |
Reproducing the bug
It's not a bug...
Context
.
Breakdown
Requirements Checklist
- [ ]
Related files
Stakeholders
Instructions for Contributors
- Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs: BreakdownThis big issue needs a checklist or subissues to describe a breakdown of work. [managed]This big issue needs a checklist or subissues to describe a breakdown of work. [managed]Needs: LeadNeeds: TriageThis issue needs triage. The team needs to decide who should own it, what to do, by when. [managed]This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed]Type: BugSomething isn't working. [managed]Something isn't working. [managed]
Type
Projects
Status
No status