Thanks for PEP 563, it helps Yuuki getting type hints, but raising the the demand of Python interpreter version to 3.7.

This commit is contained in:
SuperSonic 2020-12-19 15:21:18 +08:00
parent 0f77e7b16e
commit fca26141af
No known key found for this signature in database
GPG key ID: E511B80256C9F20D
9 changed files with 47 additions and 13 deletions

View file

@ -6,11 +6,16 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from thrift.protocol import TCompactProtocol
from thrift.transport import THttpClient
from yuuki_core.TalkService import Client, TalkException
from .config import YuukiConfig
if TYPE_CHECKING:
from .config import YuukiConfig
# NC HighSpeed Library
try:

View file

@ -6,12 +6,17 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
import time
from typing import TYPE_CHECKING
from yuuki_core.ttypes import ContentType
from ..tools import YuukiDynamicTools
from ..yuuki import Yuuki
if TYPE_CHECKING:
from ..yuuki import Yuuki
class YuukiCallback:

View file

@ -6,14 +6,18 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
import json
import time
from typing import TYPE_CHECKING
from yuuki_core.ttypes import MIDType, ContentType, OpType
from ..tools import YuukiStaticTools, YuukiDynamicTools
from ..yuuki import Yuuki
if TYPE_CHECKING:
from ..yuuki import Yuuki
class YuukiCommand:

View file

@ -6,10 +6,14 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from ..tools import YuukiStaticTools, YuukiDynamicTools
from ..yuuki import Yuuki
if TYPE_CHECKING:
from ..yuuki import Yuuki
class YuukiJoinGroup:

View file

@ -6,11 +6,16 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from yuuki_core.ttypes import OpType
from ..tools import YuukiStaticTools, YuukiDynamicTools
from ..yuuki import Yuuki
if TYPE_CHECKING:
from ..yuuki import Yuuki
def security_access_checker(function):

View file

@ -6,13 +6,18 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
import socket
import time
from typing import TYPE_CHECKING
from yuuki_core.ttypes import Operation
from .tools import YuukiStaticTools, YuukiDynamicTools
from .yuuki import Yuuki
if TYPE_CHECKING:
from .yuuki import Yuuki
class YuukiPoll:

View file

@ -6,17 +6,21 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
import json
import ntpath
import os
import random
import sys
import traceback
from typing import TYPE_CHECKING
import requests
from yuuki_core.ttypes import OpType, MIDType, ContentType, Group, Message
from .yuuki import Yuuki
if TYPE_CHECKING:
from .yuuki import Yuuki
class YuukiStaticTools:

View file

@ -18,15 +18,13 @@ from flask_bootstrap import Bootstrap
from gevent.pywsgi import WSGIServer
from .reader import YuukiWebDataReader
from ..data import YuukiData
from ..tools import YuukiDynamicTools
from ..yuuki import Yuuki
wa_app = Flask(__name__)
Yuuki_Handle = Yuuki
Yuuki_Handle_Data = YuukiData
Yuuki_APIHandle_Data = YuukiWebDataReader
Yuuki_Handle = None
Yuuki_Handle_Data = None
Yuuki_APIHandle_Data = None
passports = []
password = str(hash(random.random()))

View file

@ -6,16 +6,20 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from __future__ import annotations
import os
import platform
import random
import sys
import time
from typing import TYPE_CHECKING
from git import Repo
from yuuki_core.ttypes import OpType
from .config import YuukiConfig
if TYPE_CHECKING:
from .config import YuukiConfig
from .connection import YuukiConnect
from .data import YuukiData
from .events import YuukiCommand, YuukiJoinGroup, YuukiSecurity, YuukiCallback