Optimize imports

This commit is contained in:
Richard Chien 2018-07-02 16:54:29 +08:00
parent 5f9c558a49
commit 1527d49522
8 changed files with 13 additions and 13 deletions

View File

@ -1,16 +1,16 @@
import os import asyncio
import importlib import importlib
import logging import logging
import os
import re import re
import asyncio
from typing import Any from typing import Any
from aiocqhttp import CQHttp from aiocqhttp import CQHttp
from aiocqhttp.message import Message from aiocqhttp.message import Message
from .log import logger
from .message import handle_message from .message import handle_message
from .notice_request import handle_notice_or_request from .notice_request import handle_notice_or_request
from .log import logger
def create_bot(config_object: Any = None) -> CQHttp: def create_bot(config_object: Any = None) -> CQHttp:

View File

@ -1,5 +1,5 @@
import re
import asyncio import asyncio
import re
from datetime import datetime from datetime import datetime
from typing import ( from typing import (
Tuple, Union, Callable, Iterable, Dict, Any, Optional, Sequence Tuple, Union, Callable, Iterable, Dict, Any, Optional, Sequence
@ -9,8 +9,8 @@ from aiocqhttp import CQHttp
from aiocqhttp.message import Message from aiocqhttp.message import Message
from . import permission as perm from . import permission as perm
from .helpers import context_id
from .expression import render from .expression import render
from .helpers import context_id
from .session import BaseSession from .session import BaseSession
# Key: str (one segment of command name) # Key: str (one segment of command name)
@ -27,7 +27,8 @@ _sessions = {}
class Command: class Command:
__slots__ = ('name', 'func', 'permission', 'only_to_me', 'args_parser_func') __slots__ = (
'name', 'func', 'permission', 'only_to_me', 'args_parser_func')
def __init__(self, *, name: Tuple[str], func: Callable, permission: int, def __init__(self, *, name: Tuple[str], func: Callable, permission: int,
only_to_me: bool): only_to_me: bool):

View File

@ -1,5 +1,5 @@
import sys
import logging import logging
import sys
logger = logging.getLogger('none') logger = logging.getLogger('none')
default_handler = logging.StreamHandler(sys.stdout) default_handler = logging.StreamHandler(sys.stdout)

View File

@ -4,8 +4,8 @@ from aiocqhttp import CQHttp
from aiocqhttp.message import MessageSegment from aiocqhttp.message import MessageSegment
from .command import handle_command from .command import handle_command
from .natural_language import handle_natural_language
from .log import logger from .log import logger
from .natural_language import handle_natural_language
async def handle_message(bot: CQHttp, ctx: Dict[str, Any]) -> None: async def handle_message(bot: CQHttp, ctx: Dict[str, Any]) -> None:

View File

@ -1,5 +1,5 @@
import re
import asyncio import asyncio
import re
from collections import namedtuple from collections import namedtuple
from typing import Dict, Any, Iterable, Optional, Callable, Union from typing import Dict, Any, Iterable, Optional, Callable, Union
@ -7,9 +7,9 @@ from aiocqhttp import CQHttp
from aiocqhttp.message import Message from aiocqhttp.message import Message
from . import permission as perm from . import permission as perm
from .session import BaseSession
from .command import call_command from .command import call_command
from .log import logger from .log import logger
from .session import BaseSession
_nl_processors = set() _nl_processors = set()

View File

@ -3,8 +3,8 @@ from typing import Dict, Any, Optional, Callable, Union
from aiocqhttp import CQHttp, Error as CQHttpError from aiocqhttp import CQHttp, Error as CQHttpError
from aiocqhttp.bus import EventBus from aiocqhttp.bus import EventBus
from .session import BaseSession
from .log import logger from .log import logger
from .session import BaseSession
_bus = EventBus() _bus = EventBus()

View File

@ -1,7 +1,6 @@
from os import path from os import path
import none import none
from none_demo import config from none_demo import config
bot = none.create_bot(config) bot = none.create_bot(config)

View File

@ -14,7 +14,7 @@ setup(
description='A QQ bot framework', description='A QQ bot framework',
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
install_requires=['aiocqhttp>=0.3', 'aiocache'], install_requires=['aiocqhttp>=0.4', 'aiocache'],
python_requires='>=3.6', python_requires='>=3.6',
platforms='any', platforms='any',
classifiers=( classifiers=(