MibooGram/core/template/__init__.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
528 B
Python
Raw Normal View History

from core.base.aiobrowser import AioBrowser
from core.service import init_service
from core.base.redisdb import RedisDB
from core.template.services import TemplateService
from core.template.cache import TemplatePreviewCache, HtmlToFileIdCache
2022-07-26 10:07:31 +00:00
@init_service
def create_template_service(browser: AioBrowser, redis: RedisDB):
_preview_cache = TemplatePreviewCache(redis)
_html_to_file_id_cache = HtmlToFileIdCache(redis)
_service = TemplateService(browser, _html_to_file_id_cache, _preview_cache)
2022-07-26 10:07:31 +00:00
return _service