From 12fde22d58d3c963eca076cd072c7fd8a7b96469 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Sun, 22 Oct 2017 23:20:52 +0300 Subject: [PATCH] [Sync] Token refactoring --- utils/Sync/kazimir/Token.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/Sync/kazimir/Token.py b/utils/Sync/kazimir/Token.py index ed54d6da..7b586553 100644 --- a/utils/Sync/kazimir/Token.py +++ b/utils/Sync/kazimir/Token.py @@ -116,7 +116,7 @@ class DocumentToken(Token):
- {document['title']} + {document['title']}
@@ -137,19 +137,22 @@ class ImageToken(Token): def __init__(self, data) -> None: super().__init__(name='image', data=data) self.joinable = True + self.build = None def merge(self, token: Token): return ImageCollectionToken([self.data, token.data]) async def compile(self): img = self.parse_data() + img = await self.build(img) + alt = img['alt'] caption = img['caption'] - file = img['file'] + src = img['src'] tpl = f'''
- {caption} + {alt}
{caption}