summaryrefslogtreecommitdiff
path: root/ATRI
diff options
context:
space:
mode:
authorLint Action <[email protected]>2023-04-06 08:09:28 +0000
committerLint Action <[email protected]>2023-04-06 08:09:28 +0000
commit687b087f83c6565efdeb72c3b00ff13ef6b8c8f1 (patch)
tree891bac80c677479492b26fed9e6da23538af2b87 /ATRI
parent60be1eb2bd16fc89827a50ad18377642aae176be (diff)
downloadATRI-687b087f83c6565efdeb72c3b00ff13ef6b8c8f1.tar.gz
ATRI-687b087f83c6565efdeb72c3b00ff13ef6b8c8f1.tar.bz2
ATRI-687b087f83c6565efdeb72c3b00ff13ef6b8c8f1.zip
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI')
-rw-r--r--ATRI/database/wrapper.py12
-rw-r--r--ATRI/plugins/thesaurus/__init__.py12
2 files changed, 16 insertions, 8 deletions
diff --git a/ATRI/database/wrapper.py b/ATRI/database/wrapper.py
index 7838bd6..df6057f 100644
--- a/ATRI/database/wrapper.py
+++ b/ATRI/database/wrapper.py
@@ -6,7 +6,7 @@ from tortoise.models import Model
class DatabaseWrapper:
def __init__(self, model: Type[Model]):
self.model = model
-
+
async def __aenter__(self):
return self
@@ -15,17 +15,15 @@ class DatabaseWrapper:
async def add_sub(self, *args, **kwargs):
await self.model.create(*args, **kwargs)
-
+
async def update_sub(self, update_map: dict, **kwargs):
- await self.model.filter(**kwargs).update(
- **update_map
- )
+ await self.model.filter(**kwargs).update(**update_map)
async def del_sub(self, query_map: dict):
await self.model.filter(**query_map).delete()
-
+
async def get_sub_list(self, query_map: dict) -> list:
return await self.model.filter(**query_map)
-
+
async def get_all_subs(self) -> list:
return await self.model.all()
diff --git a/ATRI/plugins/thesaurus/__init__.py b/ATRI/plugins/thesaurus/__init__.py
index 0409008..4884801 100644
--- a/ATRI/plugins/thesaurus/__init__.py
+++ b/ATRI/plugins/thesaurus/__init__.py
@@ -228,7 +228,17 @@ async def _add_global_item(
ans = unescape(item_a).split(",,")
result = await tm.add_item(
- item_id, True, unescape(item_q), ans, need_at, item_t, 0, operator, opeartor_id, 0, list()
+ item_id,
+ True,
+ unescape(item_q),
+ ans,
+ need_at,
+ item_t,
+ 0,
+ operator,
+ opeartor_id,
+ 0,
+ list(),
)
await add_item_for_global.finish(result)