Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
Merge pull request #40 from Starry-OvO/develop
Browse files Browse the repository at this point in the history
Update 0.7.0
  • Loading branch information
lumina37 authored Sep 1, 2024
2 parents 1c3b366 + 80d3108 commit 1259fc0
Show file tree
Hide file tree
Showing 9 changed files with 399 additions and 528 deletions.
2 changes: 1 addition & 1 deletion aiotieba_reviewer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
set_fname,
)
from .config import get_account
from .database import MySQLDB, SQLiteDB
from .database import PostgreDB, SQLiteDB
from .enums import Ops
from .perf_stat import aperf_stat
from .punish import Punish
Expand Down
2 changes: 1 addition & 1 deletion aiotieba_reviewer/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.2"
__version__ = "0.7.0"
12 changes: 6 additions & 6 deletions aiotieba_reviewer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import aiotieba as tb

from .config import get_account
from .database import MySQLDB, SQLiteDB
from .database import PostgreDB, SQLiteDB

_fname = ''
_db_sqlite = None

client_generator: AsyncGenerator[tb.Client, None] = None
db_generator: AsyncGenerator[MySQLDB, None] = None
db_generator: AsyncGenerator[PostgreDB, None] = None


def set_BDUSS_key(BDUSS_key: str) -> None:
Expand Down Expand Up @@ -53,7 +53,7 @@ def set_fname(fname: str) -> None:
_fname = fname

async def _db_generator():
async with MySQLDB(fname) as db:
async with PostgreDB(fname) as db:
while 1:
yield db

Expand All @@ -68,12 +68,12 @@ def get_fname() -> str:
return _fname


async def get_db() -> MySQLDB:
async def get_db() -> PostgreDB:
"""
获取一个MySQL客户端
获取一个PostgreSQL客户端
Returns:
MySQLDB
PostgreDB
"""

return await db_generator.__anext__()
Expand Down
2 changes: 1 addition & 1 deletion aiotieba_reviewer/database/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .mysql import MySQLDB
from .postgre import PostgreDB
from .sqlite import SQLiteDB
Loading

0 comments on commit 1259fc0

Please sign in to comment.