notionary 0.1.26__py3-none-any.whl → 0.1.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- notionary/page/metadata/notion_icon_manager.py +12 -6
- notionary/page/metadata/notion_page_cover_manager.py +11 -1
- notionary/page/notion_page.py +1 -1
- {notionary-0.1.26.dist-info → notionary-0.1.28.dist-info}/METADATA +1 -1
- {notionary-0.1.26.dist-info → notionary-0.1.28.dist-info}/RECORD +8 -8
- {notionary-0.1.26.dist-info → notionary-0.1.28.dist-info}/WHEEL +1 -1
- {notionary-0.1.26.dist-info → notionary-0.1.28.dist-info}/licenses/LICENSE +0 -0
- {notionary-0.1.26.dist-info → notionary-0.1.28.dist-info}/top_level.txt +0 -0
@@ -26,19 +26,25 @@ class NotionPageIconManager(LoggingMixin):
|
|
26
26
|
Retrieves the page icon - either emoji or external URL.
|
27
27
|
|
28
28
|
Returns:
|
29
|
-
str: Emoji character or URL if set, None if no icon
|
29
|
+
Optional[str]: Emoji character or URL if set, None if no icon
|
30
30
|
"""
|
31
31
|
page_data = await self._client.get_page(self.page_id)
|
32
32
|
|
33
|
-
if not page_data
|
34
|
-
return
|
33
|
+
if not page_data:
|
34
|
+
return ""
|
35
|
+
|
36
|
+
# Get icon data, default to empty dict if not present or None
|
37
|
+
icon_data = page_data.get("icon")
|
38
|
+
|
39
|
+
# If icon is None or not present, return None
|
40
|
+
if not icon_data:
|
41
|
+
return ""
|
35
42
|
|
36
|
-
icon_data = page_data.get("icon", {})
|
37
43
|
icon_type = icon_data.get("type")
|
38
44
|
|
39
45
|
if icon_type == "emoji":
|
40
46
|
return icon_data.get("emoji")
|
41
|
-
|
47
|
+
if icon_type == "external":
|
42
48
|
return icon_data.get("external", {}).get("url")
|
43
49
|
|
44
|
-
return
|
50
|
+
return ""
|
@@ -40,4 +40,14 @@ class NotionPageCoverManager(LoggingMixin):
|
|
40
40
|
if not page_data:
|
41
41
|
return ""
|
42
42
|
|
43
|
-
|
43
|
+
cover = page_data.get("cover")
|
44
|
+
|
45
|
+
if not cover or not isinstance(cover, dict):
|
46
|
+
return ""
|
47
|
+
|
48
|
+
external = cover.get("external")
|
49
|
+
|
50
|
+
if not external or not isinstance(external, dict):
|
51
|
+
return ""
|
52
|
+
|
53
|
+
return external.get("url", "")
|
notionary/page/notion_page.py
CHANGED
@@ -204,7 +204,7 @@ class NotionPage(LoggingMixin):
|
|
204
204
|
"""
|
205
205
|
return await self._page_icon_manager.set_icon(emoji, external_url)
|
206
206
|
|
207
|
-
async def get_icon(self) ->
|
207
|
+
async def get_icon(self) -> str:
|
208
208
|
"""
|
209
209
|
Retrieve the page icon - either emoji or external URL.
|
210
210
|
|
@@ -32,14 +32,14 @@ notionary/elements/registry/block_element_registry_builder.py,sha256=C6W64CwFqZB
|
|
32
32
|
notionary/exceptions/database_exceptions.py,sha256=I-Tx6bYRLpi5pjGPtbT-Mqxvz3BFgYTiuZxknJeLxtI,2638
|
33
33
|
notionary/exceptions/page_creation_exception.py,sha256=4v7IuZD6GsQLrqhDLriGjuG3ML638gAO53zDCrLePuU,281
|
34
34
|
notionary/page/markdown_to_notion_converter.py,sha256=LFnv98uU3QRzxH7sZI0AE5_QxeHkNQZMxVcab-r8Qls,15877
|
35
|
-
notionary/page/notion_page.py,sha256=
|
35
|
+
notionary/page/notion_page.py,sha256=OXE2sw9Drkqduy96uVvXT3vHwHPh5FMJk6QyPRADoFU,17653
|
36
36
|
notionary/page/notion_page_factory.py,sha256=UUEZ-cyEWL0OMVPrgjc4vJdcplEa1bO2yHCYooACYC8,8189
|
37
37
|
notionary/page/notion_to_markdown_converter.py,sha256=EUiHeurQb73zQJ5Gatvf_67vWd-vOI8qg3yFLz8bf8Q,6452
|
38
38
|
notionary/page/content/notion_page_content_chunker.py,sha256=xRks74Dqec-De6-AVTxMPnXs-MSJBzSm1HfJfaHiKr8,3330
|
39
39
|
notionary/page/content/page_content_manager.py,sha256=0Bl52mEqKuhDGuJhOEMhGjJWHgxCiqGYjrqO1LqYzJM,6403
|
40
40
|
notionary/page/metadata/metadata_editor.py,sha256=61uiw8oB25O8ePhytoJvZDetuof5sjPoM6aoHZGo4wc,4949
|
41
|
-
notionary/page/metadata/notion_icon_manager.py,sha256=
|
42
|
-
notionary/page/metadata/notion_page_cover_manager.py,sha256=
|
41
|
+
notionary/page/metadata/notion_icon_manager.py,sha256=I4MczURRYc1PV0qDFwbCCzicqiDyOhKpdk9E2b9lWMc,1579
|
42
|
+
notionary/page/metadata/notion_page_cover_manager.py,sha256=hasXPIbTy9rD55tHr_zzF2yj_lD0RsULz5UP0rNRx4g,1929
|
43
43
|
notionary/page/properites/database_property_service.py,sha256=AJuBGahbb53VQa6IGGHxBMoOgCy6vFZg08uR_eDjNUs,11570
|
44
44
|
notionary/page/properites/page_property_manager.py,sha256=Xl8Cwn8WVszqpFXT_NvASkmP5igpCTEgRVhG_F45424,6914
|
45
45
|
notionary/page/properites/property_formatter.py,sha256=d_Nr5XQxgjB6VIS0u3ey14MOUKY416o_BvdXjbkUNAQ,3667
|
@@ -51,8 +51,8 @@ notionary/page/relations/page_database_relation.py,sha256=F9aGXFjjL8ZLNbfTGeGm_Q
|
|
51
51
|
notionary/page/relations/relation_operation_result.py,sha256=NDxBzGntOxc_89ti-HG8xDSqfY6PwyGHKHrrKbCzNjM,5010
|
52
52
|
notionary/util/logging_mixin.py,sha256=fKsx9t90bwvL74ZX3dU-sXdC4TZCQyO6qU9I8txkw_U,1369
|
53
53
|
notionary/util/page_id_utils.py,sha256=EYNMxgf-7ghzL5K8lKZBZfW7g5CsdY0Xuj4IYmU8RPk,1381
|
54
|
-
notionary-0.1.
|
55
|
-
notionary-0.1.
|
56
|
-
notionary-0.1.
|
57
|
-
notionary-0.1.
|
58
|
-
notionary-0.1.
|
54
|
+
notionary-0.1.28.dist-info/licenses/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
|
55
|
+
notionary-0.1.28.dist-info/METADATA,sha256=09cAT-X3imeOHrG-VKtcOLSUJ_pPLiioAnxJ2e4cdwg,8342
|
56
|
+
notionary-0.1.28.dist-info/WHEEL,sha256=GHB6lJx2juba1wDgXDNlMTyM13ckjBMKf-OnwgKOCtA,91
|
57
|
+
notionary-0.1.28.dist-info/top_level.txt,sha256=fhONa6BMHQXqthx5PanWGbPL0b8rdFqhrJKVLf_adSs,10
|
58
|
+
notionary-0.1.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|