diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index d6db987..ef6cd73 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -22,4 +22,5 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + - run: pip install setuptools - uses: pre-commit/action@v2.0.0 diff --git a/js/EmbedContentRequest.js b/js/EmbedContentRequest.js index c6ae021..9a83900 100644 --- a/js/EmbedContentRequest.js +++ b/js/EmbedContentRequest.js @@ -52,7 +52,8 @@ export const SCHEMA = { "slideshow_image", "slideshow_thumbnail", "slideshow_manifest", - "imscp_zip" + "imscp_zip", + "bloompub" ] }, "file": { diff --git a/le_utils/constants/content_kinds.py b/le_utils/constants/content_kinds.py index 1981eed..09cd146 100644 --- a/le_utils/constants/content_kinds.py +++ b/le_utils/constants/content_kinds.py @@ -43,6 +43,7 @@ file_formats.HTML5: HTML5, file_formats.H5P: H5P, file_formats.ZIM: ZIM, + file_formats.BLOOMPUB: DOCUMENT, } diff --git a/le_utils/constants/embed_content_request.py b/le_utils/constants/embed_content_request.py index f7344c4..451a030 100644 --- a/le_utils/constants/embed_content_request.py +++ b/le_utils/constants/embed_content_request.py @@ -59,6 +59,7 @@ "slideshow_thumbnail", "slideshow_manifest", "imscp_zip", + "bloompub", ], }, "file": { diff --git a/le_utils/constants/file_formats.py b/le_utils/constants/file_formats.py index ccc14a2..b7e09da 100644 --- a/le_utils/constants/file_formats.py +++ b/le_utils/constants/file_formats.py @@ -76,6 +76,10 @@ EPUB = "epub" EPUB_MIMETYPE = "application/epub+zip" +# constants for bloomPub format +BLOOMPUB = "bloompub" +BLOOMPUB_MIMETYPE = "application/bloompub+zip" + choices = ( (MP4, "MP4 Video"), (WEBM, "WEBM Video"), @@ -94,6 +98,7 @@ (H5P, "H5P"), (ZIM, "ZIM"), (EPUB, "ePub Document"), + (BLOOMPUB, "Bloom Document"), ) diff --git a/le_utils/constants/file_types.py b/le_utils/constants/file_types.py index 48a9665..5c9e453 100644 --- a/le_utils/constants/file_types.py +++ b/le_utils/constants/file_types.py @@ -12,6 +12,7 @@ THUMBNAIL = "thumbnail" SUBTITLES = "subtitles" SLIDESHOW_IMAGE = "slideshow_image" +BLOOMPUB = "bloompub" """ File Format (extension) to File Type Mapping """ @@ -28,6 +29,7 @@ # DocumentFile formats file_formats.PDF: DOCUMENT, file_formats.EPUB: EPUB, + file_formats.BLOOMPUB: BLOOMPUB, # # formats HTMLZipFile file_formats.HTML5: HTML5, diff --git a/le_utils/constants/format_presets.py b/le_utils/constants/format_presets.py index 119fc3a..6cde15a 100644 --- a/le_utils/constants/format_presets.py +++ b/le_utils/constants/format_presets.py @@ -34,6 +34,8 @@ EPUB_READABLE = "ePub Document" DOCUMENT_THUMBNAIL = "document_thumbnail" DOCUMENT_THUMBNAIL_READABLE = "Thumbnail" +BLOOMPUB = "bloompub" +BLOOMPUB_READABLE = "Bloom Document" EXERCISE = "exercise" EXERCISE_READABLE = "Exercise" @@ -118,6 +120,7 @@ (SLIDESHOW_THUMBNAIL, SLIDESHOW_THUMBNAIL_READABLE), (SLIDESHOW_MANIFEST, SLIDESHOW_MANIFEST_READABLE), (IMSCP_ZIP, IMSCP_ZIP_READABLE), + (BLOOMPUB, BLOOMPUB_READABLE), ) diff --git a/le_utils/resources/formatlookup.json b/le_utils/resources/formatlookup.json index 6ce65ce..6d3ccc0 100644 --- a/le_utils/resources/formatlookup.json +++ b/le_utils/resources/formatlookup.json @@ -49,5 +49,8 @@ }, "zip": { "mimetype": ".zip" + }, + "bloompub": { + "mimetype": "application/bloompub+zip" } } diff --git a/le_utils/resources/presetlookup.json b/le_utils/resources/presetlookup.json index 5e8e027..80e8bf5 100644 --- a/le_utils/resources/presetlookup.json +++ b/le_utils/resources/presetlookup.json @@ -358,5 +358,17 @@ "kind": "slideshow", "allowed_formats": ["json"], "convertible_formats": [] + }, + "bloompub": { + "readable_name": "Bloom Document", + "multi_language": false, + "supplementary": false, + "thumbnail": false, + "subtitle": false, + "display": true, + "order": 1, + "kind": "document", + "allowed_formats": ["bloompub"], + "convertible_formats": [] } } diff --git a/spec/schema-embed_content_request.json b/spec/schema-embed_content_request.json index 761bce8..38b071c 100644 --- a/spec/schema-embed_content_request.json +++ b/spec/schema-embed_content_request.json @@ -47,7 +47,8 @@ "slideshow_image", "slideshow_thumbnail", "slideshow_manifest", - "imscp_zip" + "imscp_zip", + "bloompub" ] }, "file": {