[Sync] Kazimir refactoring. Signature changed
This commit is contained in:
1 parent
bb7ab3b95e
commit
9820b4a1c2
3 files changed
+3
-5
No files matched your search
@@ -22,7 +22,7 @@ def get_images_src(text: str) -> [str]:
|
||||
return [img.get('src') for img in images]
|
||||
|
||||
|
||||
def kazimir_to_html(text: str) -> str:
|
||||
def create_tree(text: str) -> str:
|
||||
tokens = text.split('\n')
|
||||
tokens = markup_tokens(tokens)
|
||||
tokens = join_tokens(tokens)
|
||||
|
||||
@@ -7,7 +7,6 @@ import lxml.html
|
||||
import kazimir
|
||||
import settings
|
||||
from db import collection
|
||||
from kazimir import kazimir_to_html
|
||||
from sync import create_date_and_title_from_folder_name, images_from_html, create_post_from_image_list, create_date, \
|
||||
create_post
|
||||
from sync.data import Provider, list_images
|
||||
|
||||
@@ -7,7 +7,7 @@ import lxml.html
|
||||
import kazimir
|
||||
import settings
|
||||
from db import collection
|
||||
from kazimir import kazimir_to_html
|
||||
from kazimir import create_tree
|
||||
from sync import create_date_and_title_from_folder_name, images_from_html, create_post_from_image_list, create_date
|
||||
from sync.data import Provider, list_images
|
||||
from sync.models import Model
|
||||
@@ -170,8 +170,7 @@ def read_manifest(provider, path):
|
||||
|
||||
|
||||
async def create_post(provider: Provider, folder: str, md: str, sizes):
|
||||
post = kazimir.kazimir_to_html(md)
|
||||
html = lxml.html.fromstring(post)
|
||||
html = kazimir.create_tree(md)
|
||||
images = []
|
||||
for img in html.cssselect('img'):
|
||||
src = img.get('src')
|
||||
|
||||
Reference in new issue
Block a user