Commit c43dc8f
committed
Convert the Bibliotheca integration into a package
The Bibliotheca integration was five flat bibliotheca_* modules sitting
directly in integration/license/, while every other integration
(overdrive/, boundless/, opds/) is a package. Restructure it to match.
The five modules become bibliotheca/{api,importer,purchase_record_importer,
circulation_updater,scripts}.py, and the 1295-line api.py is split along
the same seams the siblings use: settings.py (as in overdrive and
boundless), parser.py (as in boundless), and coverage.py (as in
overdrive).
Splitting the parsers out exposed a cycle: BibliothecaAPI constructs the
parsers, but ErrorParser, EventParser and PatronCirculationParser reached
back for BibliothecaAPI.SERVICE_NAME and .ARGUMENT_TIME_FORMAT. Add a
constants.py holding those values and point the parsers at it, mirroring
how boundless/parser.py and overdrive/coverage.py already avoid the same
cycle. BibliothecaAPI keeps both class attributes, so nothing that reads
them off the API changes.
Also drop EventParser.EVENT_SOURCE and EventParser.SET_DELIVERY_MECHANISM_AT.
Both were unread: EVENT_SOURCE has no readers anywhere, and the two sites
that read SET_DELIVERY_MECHANISM_AT do so off a BaseCirculationAPI, which
EventParser is not. Removing them lets parser.py stop importing the
circulation API layer entirely. BibliothecaAPI.SET_DELIVERY_MECHANISM_AT
is a different attribute on a different class and is untouched.
Mirror the layout in tests/, moving the fixture into a conftest.py as
boundless does. TestBibliographicCoverageProvider subclassed
TestBibliothecaAPI without using anything from it, which made pytest
re-run all 22 API tests a second time; it no longer does. All 38 declared
tests are preserved, with test_internal_formats moving to
TestItemListParser, the class it actually exercises.1 parent ff7fa19 commit c43dc8f
41 files changed
Lines changed: 2129 additions & 2028 deletions
File tree
- bin
- informational
- repair
- src/palace/manager
- celery/tasks
- integration/license
- bibliotheca
- scripts
- service/integration_registry
- tests
- fixtures
- manager
- api
- circulation
- controller
- celery/tasks
- core
- feed/worklist
- integration/license/bibliotheca
- scripts
- sqlalchemy/model
- mocks
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
0 commit comments