Skip to content

Commit

Permalink
release 0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Clouder0 committed Apr 9, 2022
1 parent 684c3f4 commit 7a6fe01
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions AnkiSiyuan/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@


async def execute():
if not ankihelper.check_online():
print("Anki is not online! Please open Anki and make sure anki-connect is installed.")
return
start_time = time.perf_counter()
config_parser.parse()
print("Api Token:{}".format(conf["siyuan"]["api_token"]))
Expand Down
7 changes: 5 additions & 2 deletions AnkiSiyuan/parser/siyuan.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from AnkiIn.helper.formatHelper import remove_suffix
from siyuanhelper.helper import PropertyNotFoundException, do_property_exist_by_id, get_parent_by_id
from siyuanhelper.helper import get_property_by_id, query_sql, get_col_by_id
from siyuanhelper.helper import set_token
from siyuanhelper.helper import set_token, set_session
from AnkiIn.parser import markdown
from AnkiIn.notetype_loader import discovered_notetypes
from ..notetypes import SQA, SMQA, SCloze, SListCloze, STableCloze, SWatch
Expand All @@ -11,6 +11,7 @@
from AnkiIn import config
from AnkiIn.log import parser_logger as logger
import asyncio
import aiohttp


class SyntaxNode:
Expand Down Expand Up @@ -77,6 +78,8 @@ async def sync(last_time: str):
# session = aiohttp.ClientSession()
# set_session(session)
set_token(conf["siyuan"].get("api_token", ""))
session = aiohttp.ClientSession()
set_session(session)
link.clear()
is_added.clear()
roots.clear()
Expand All @@ -93,7 +96,7 @@ async def sync(last_time: str):
# print([get_col_by_id(x.id,"markdown") for x in roots])
for x in roots:
await dfs(x)
# await session.close()
await session.close()
return noteList


Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = AnkiSiyuan
version = 0.0.4
version = 0.0.5
author = Clouder
author_email = clouder0@outlook.com
description = Sync SiYuan with Anki
Expand All @@ -18,6 +18,6 @@ classifiers =
packages = find:
install_requires =
AnkiIn
siyuanhelper
siyuanhelper >= 0.0.3
aiohttp
python_requires = >=3.6

0 comments on commit 7a6fe01

Please sign in to comment.