-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Replace our custom web manifest parser with Pydantic models. I replace the validation we were doing via a patched json schema with the pydantic parser, since it gives better errors and more closely matches what we are expecting in Palace.
- Loading branch information
1 parent
5a49b70
commit 71ef9d4
Showing
36 changed files
with
370 additions
and
2,107 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
#!/usr/bin/env python | ||
"""Update the circulation manager server with new books from OPDS 2.0 import collections.""" | ||
from webpub_manifest_parser.opds2 import OPDS2FeedParserFactory | ||
|
||
from palace.manager.core.opds2_import import ( | ||
OPDS2Importer, | ||
OPDS2ImportMonitor, | ||
RWPMManifestParser, | ||
) | ||
from palace.manager.core.opds2_import import OPDS2Importer, OPDS2ImportMonitor | ||
from palace.manager.scripts.opds_import import OPDSImportScript | ||
|
||
import_script = OPDSImportScript( | ||
importer_class=OPDS2Importer, | ||
monitor_class=OPDS2ImportMonitor, | ||
protocol=OPDS2Importer.NAME, | ||
parser=RWPMManifestParser(OPDS2FeedParserFactory()), | ||
) | ||
|
||
import_script.run() |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.