From a12be97645c8d57e0a511ecff116cbd3b4feb61b Mon Sep 17 00:00:00 2001 From: Divyansh Agarwal Date: Wed, 24 Jul 2024 20:04:31 +0530 Subject: [PATCH 1/2] Add constants for bloomd format --- le_utils/constants/content_kinds.py | 1 + le_utils/constants/file_formats.py | 2 ++ le_utils/constants/file_types.py | 1 + le_utils/constants/format_presets.py | 2 ++ le_utils/resources/formatlookup.json | 3 +++ le_utils/resources/presetlookup.json | 2 +- 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/le_utils/constants/content_kinds.py b/le_utils/constants/content_kinds.py index 09cd146..1ffe2dd 100644 --- a/le_utils/constants/content_kinds.py +++ b/le_utils/constants/content_kinds.py @@ -44,6 +44,7 @@ file_formats.H5P: H5P, file_formats.ZIM: ZIM, file_formats.BLOOMPUB: DOCUMENT, + file_formats.BLOOMD: DOCUMENT, } diff --git a/le_utils/constants/file_formats.py b/le_utils/constants/file_formats.py index b7e09da..e8e7521 100644 --- a/le_utils/constants/file_formats.py +++ b/le_utils/constants/file_formats.py @@ -78,6 +78,7 @@ # constants for bloomPub format BLOOMPUB = "bloompub" +BLOOMD = "bloomd" BLOOMPUB_MIMETYPE = "application/bloompub+zip" choices = ( @@ -99,6 +100,7 @@ (ZIM, "ZIM"), (EPUB, "ePub Document"), (BLOOMPUB, "Bloom Document"), + (BLOOMD, "Bloom Document"), ) diff --git a/le_utils/constants/file_types.py b/le_utils/constants/file_types.py index 5c9e453..a387b25 100644 --- a/le_utils/constants/file_types.py +++ b/le_utils/constants/file_types.py @@ -30,6 +30,7 @@ file_formats.PDF: DOCUMENT, file_formats.EPUB: EPUB, file_formats.BLOOMPUB: BLOOMPUB, + file_formats.BLOOMD: BLOOMPUB, # # formats HTMLZipFile file_formats.HTML5: HTML5, diff --git a/le_utils/constants/format_presets.py b/le_utils/constants/format_presets.py index 6cde15a..a7c57de 100644 --- a/le_utils/constants/format_presets.py +++ b/le_utils/constants/format_presets.py @@ -35,6 +35,7 @@ DOCUMENT_THUMBNAIL = "document_thumbnail" DOCUMENT_THUMBNAIL_READABLE = "Thumbnail" BLOOMPUB = "bloompub" +BLOOMD = "bloomd" BLOOMPUB_READABLE = "Bloom Document" EXERCISE = "exercise" @@ -121,6 +122,7 @@ (SLIDESHOW_MANIFEST, SLIDESHOW_MANIFEST_READABLE), (IMSCP_ZIP, IMSCP_ZIP_READABLE), (BLOOMPUB, BLOOMPUB_READABLE), + (BLOOMD, BLOOMPUB_READABLE), ) diff --git a/le_utils/resources/formatlookup.json b/le_utils/resources/formatlookup.json index 6d3ccc0..c75de2b 100644 --- a/le_utils/resources/formatlookup.json +++ b/le_utils/resources/formatlookup.json @@ -52,5 +52,8 @@ }, "bloompub": { "mimetype": "application/bloompub+zip" + }, + "bloomd": { + "mimetype": "application/bloompub+zip" } } diff --git a/le_utils/resources/presetlookup.json b/le_utils/resources/presetlookup.json index 80e8bf5..860b1f5 100644 --- a/le_utils/resources/presetlookup.json +++ b/le_utils/resources/presetlookup.json @@ -368,7 +368,7 @@ "display": true, "order": 1, "kind": "document", - "allowed_formats": ["bloompub"], + "allowed_formats": ["bloompub", "bloomd"], "convertible_formats": [] } } From 357f2cc15a5c551b50a273fb714c65f4648e3e4e Mon Sep 17 00:00:00 2001 From: Divyansh Agarwal Date: Mon, 5 Aug 2024 21:56:18 +0530 Subject: [PATCH 2/2] Remove bloomd as a separate format preset --- le_utils/constants/format_presets.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/le_utils/constants/format_presets.py b/le_utils/constants/format_presets.py index a7c57de..6cde15a 100644 --- a/le_utils/constants/format_presets.py +++ b/le_utils/constants/format_presets.py @@ -35,7 +35,6 @@ DOCUMENT_THUMBNAIL = "document_thumbnail" DOCUMENT_THUMBNAIL_READABLE = "Thumbnail" BLOOMPUB = "bloompub" -BLOOMD = "bloomd" BLOOMPUB_READABLE = "Bloom Document" EXERCISE = "exercise" @@ -122,7 +121,6 @@ (SLIDESHOW_MANIFEST, SLIDESHOW_MANIFEST_READABLE), (IMSCP_ZIP, IMSCP_ZIP_READABLE), (BLOOMPUB, BLOOMPUB_READABLE), - (BLOOMD, BLOOMPUB_READABLE), )