sort imports with isort
This commit is contained in:
parent
9b31aff951
commit
066f819e9c
19 changed files with 93 additions and 70 deletions
|
@ -1,11 +1,13 @@
|
|||
import asyncio, re
|
||||
import asyncio
|
||||
import re
|
||||
from argparse import ArgumentParser
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from irctokens import build, Line
|
||||
from irctokens import Line, build
|
||||
|
||||
from ircrobots import Bot as BaseBot
|
||||
from ircrobots import Server as BaseServer
|
||||
from ircrobots import ConnectionParams
|
||||
from ircrobots import Server as BaseServer
|
||||
|
||||
TRIGGER = "!"
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import asyncio
|
||||
|
||||
from irctokens import build, Line
|
||||
from irctokens import Line, build
|
||||
|
||||
from ircrobots import SASLSCRAM
|
||||
from ircrobots import Bot as BaseBot
|
||||
from ircrobots import ConnectionParams, SASLUserPass
|
||||
from ircrobots import Server as BaseServer
|
||||
from ircrobots import ConnectionParams, SASLUserPass, SASLSCRAM
|
||||
|
||||
|
||||
class Server(BaseServer):
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import asyncio
|
||||
|
||||
from irctokens import build, Line
|
||||
from irctokens import Line, build
|
||||
|
||||
from ircrobots import Bot as BaseBot
|
||||
from ircrobots import Server as BaseServer
|
||||
from ircrobots import ConnectionParams
|
||||
from ircrobots import Server as BaseServer
|
||||
|
||||
SERVERS = [("freenode", "chat.freenode.invalid")]
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
from .bot import Bot
|
||||
from .server import Server
|
||||
from .params import (
|
||||
ConnectionParams,
|
||||
SASLUserPass,
|
||||
SASLExternal,
|
||||
SASLSCRAM,
|
||||
STSPolicy,
|
||||
ResumePolicy,
|
||||
)
|
||||
from .ircv3 import Capability
|
||||
from .params import (
|
||||
SASLSCRAM,
|
||||
ConnectionParams,
|
||||
ResumePolicy,
|
||||
SASLExternal,
|
||||
SASLUserPass,
|
||||
STSPolicy,
|
||||
)
|
||||
from .server import Server
|
||||
|
|
|
@ -2,9 +2,10 @@ from asyncio import Future
|
|||
from typing import Any, Awaitable, Callable, Generator, Generic, Optional, TypeVar
|
||||
|
||||
from irctokens import Line
|
||||
from .matching import IMatchResponse
|
||||
|
||||
from .interface import IServer
|
||||
from .ircv3 import TAG_LABEL
|
||||
from .matching import IMatchResponse
|
||||
|
||||
TEvent = TypeVar("TEvent")
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import asyncio, traceback
|
||||
import anyio
|
||||
import asyncio
|
||||
import traceback
|
||||
from typing import Dict
|
||||
|
||||
import anyio
|
||||
from ircstates.server import ServerDisconnectedException
|
||||
|
||||
from .interface import IBot, IServer, ITCPTransport
|
||||
from .server import ConnectionParams, Server
|
||||
from .transport import TCPTransport
|
||||
from .interface import IBot, IServer, ITCPTransport
|
||||
|
||||
|
||||
class Bot(IBot):
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
from .interface import IServer
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
from asyncio import Future
|
||||
from typing import Awaitable, Iterable, List, Optional, Set, Tuple, Union
|
||||
from enum import IntEnum
|
||||
from typing import Awaitable, Iterable, List, Optional, Set, Tuple, Union
|
||||
|
||||
from ircstates import Server, Emit
|
||||
from irctokens import Line, Hostmask
|
||||
from ircstates import Emit, Server
|
||||
from irctokens import Hostmask, Line
|
||||
|
||||
from .params import ConnectionParams, SASLParams, STSPolicy, ResumePolicy
|
||||
from .params import ConnectionParams, ResumePolicy, SASLParams, STSPolicy
|
||||
from .security import TLS
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
from dataclasses import dataclass
|
||||
from time import time
|
||||
from typing import Dict, Iterable, List, Optional, Tuple
|
||||
from dataclasses import dataclass
|
||||
from irctokens import build
|
||||
|
||||
from ircstates.server import ServerDisconnectedException
|
||||
from irctokens import build
|
||||
|
||||
from .contexts import ServerContext
|
||||
from .matching import Response, ANY
|
||||
from .interface import ICapability
|
||||
from .params import ConnectionParams, STSPolicy, ResumePolicy
|
||||
from .matching import ANY, Response
|
||||
from .params import ConnectionParams, ResumePolicy, STSPolicy
|
||||
from .security import TLS_VERIFYCHAIN
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
from .responses import *
|
||||
from .params import *
|
||||
from .responses import *
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
from re import compile as re_compile
|
||||
from typing import Optional, Pattern, Union
|
||||
|
||||
from irctokens import Hostmask
|
||||
|
||||
from .. import formatting
|
||||
from ..glob import Glob
|
||||
from ..glob import compile as glob_compile
|
||||
from ..interface import (
|
||||
IMatchResponseHostmask,
|
||||
IMatchResponseParam,
|
||||
IMatchResponseValueParam,
|
||||
IMatchResponseHostmask,
|
||||
IServer,
|
||||
)
|
||||
from ..glob import Glob, compile as glob_compile
|
||||
from .. import formatting
|
||||
|
||||
|
||||
class Any(IMatchResponseParam):
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
from typing import List, Optional, Sequence, Union
|
||||
|
||||
from irctokens import Line
|
||||
|
||||
from ..interface import (
|
||||
IServer,
|
||||
IMatchResponse,
|
||||
IMatchResponseParam,
|
||||
IMatchResponseHostmask,
|
||||
IMatchResponseParam,
|
||||
IServer,
|
||||
)
|
||||
from .params import *
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from dataclasses import dataclass, field
|
||||
from re import compile as re_compile
|
||||
from typing import List, Optional
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
from .security import TLS, TLS_NOVERIFY, TLS_VERIFYCHAIN
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
from typing import List
|
||||
from enum import Enum
|
||||
from base64 import b64decode, b64encode
|
||||
from irctokens import build
|
||||
from ircstates.numerics import *
|
||||
from enum import Enum
|
||||
from typing import List
|
||||
|
||||
from ircstates.numerics import *
|
||||
from irctokens import build
|
||||
|
||||
from .matching import Responses, Response, ANY
|
||||
from .contexts import ServerContext
|
||||
from .params import SASLParams, SASLUserPass, SASLSCRAM, SASLExternal
|
||||
from .scram import SCRAMContext, SCRAMAlgorithm
|
||||
from .matching import ANY, Response, Responses
|
||||
from .params import SASLSCRAM, SASLExternal, SASLParams, SASLUserPass
|
||||
from .scram import SCRAMAlgorithm, SCRAMContext
|
||||
|
||||
SASL_SCRAM_MECHANISMS = [
|
||||
"SCRAM-SHA-512",
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import base64, hashlib, hmac, os
|
||||
import base64
|
||||
import hashlib
|
||||
import hmac
|
||||
import os
|
||||
from enum import Enum
|
||||
from typing import Dict
|
||||
|
||||
|
||||
# IANA Hash Function Textual Names
|
||||
# https://tools.ietf.org/html/rfc5802#section-4
|
||||
# https://www.iana.org/assignments/hash-function-text-names/
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import asyncio
|
||||
from asyncio import Future, PriorityQueue
|
||||
from collections import deque
|
||||
from time import monotonic
|
||||
from typing import (
|
||||
AsyncIterable,
|
||||
Awaitable,
|
||||
|
@ -12,42 +14,42 @@ from typing import (
|
|||
Tuple,
|
||||
Union,
|
||||
)
|
||||
from collections import deque
|
||||
from time import monotonic
|
||||
|
||||
import anyio
|
||||
from async_timeout import timeout as timeout_
|
||||
from asyncio_rlock import RLock
|
||||
from asyncio_throttle import Throttler
|
||||
from async_timeout import timeout as timeout_
|
||||
from ircstates import Emit, Channel, ChannelUser
|
||||
from ircstates import Channel, ChannelUser, Emit
|
||||
from ircstates.names import Name
|
||||
from ircstates.numerics import *
|
||||
from ircstates.server import ServerDisconnectedException
|
||||
from ircstates.names import Name
|
||||
from irctokens import build, Line, tokenise
|
||||
from irctokens import Line, build, tokenise
|
||||
|
||||
from .ircv3 import (
|
||||
CAPContext,
|
||||
sts_transmute,
|
||||
CAP_ECHO,
|
||||
CAP_SASL,
|
||||
CAP_LABEL,
|
||||
LABEL_TAG_MAP,
|
||||
resume_transmute,
|
||||
)
|
||||
from .sasl import SASLContext, SASLResult
|
||||
from .matching import ResponseOr, Responses, Response, ANY, SELF, MASK_SELF, Folded
|
||||
from .asyncs import MaybeAwait, WaitFor
|
||||
from .struct import Whois
|
||||
from .params import ConnectionParams, SASLParams, STSPolicy, ResumePolicy
|
||||
from .interface import (
|
||||
IBot,
|
||||
ICapability,
|
||||
IServer,
|
||||
SentLine,
|
||||
SendPriority,
|
||||
IMatchResponse,
|
||||
IServer,
|
||||
ITCPReader,
|
||||
ITCPTransport,
|
||||
ITCPWriter,
|
||||
SendPriority,
|
||||
SentLine,
|
||||
)
|
||||
from .interface import ITCPTransport, ITCPReader, ITCPWriter
|
||||
from .ircv3 import (
|
||||
CAP_ECHO,
|
||||
CAP_LABEL,
|
||||
CAP_SASL,
|
||||
LABEL_TAG_MAP,
|
||||
CAPContext,
|
||||
resume_transmute,
|
||||
sts_transmute,
|
||||
)
|
||||
from .matching import ANY, MASK_SELF, SELF, Folded, Response, ResponseOr, Responses
|
||||
from .params import ConnectionParams, ResumePolicy, SASLParams, STSPolicy
|
||||
from .sasl import SASLContext, SASLResult
|
||||
from .struct import Whois
|
||||
|
||||
THROTTLE_RATE = 4 # lines
|
||||
THROTTLE_TIME = 2 # seconds
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from typing import List, Optional
|
||||
from dataclasses import dataclass
|
||||
from typing import List, Optional
|
||||
|
||||
from ircstates import ChannelUser
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
from asyncio import StreamReader, StreamWriter
|
||||
from hashlib import sha512
|
||||
from ssl import SSLContext
|
||||
from typing import Optional, Tuple
|
||||
from asyncio import StreamReader, StreamWriter
|
||||
|
||||
from async_stagger import open_connection
|
||||
|
||||
from .interface import ITCPTransport, ITCPReader, ITCPWriter
|
||||
from .security import tls_context, TLS, TLSNoVerify, TLSVerifyHash, TLSVerifySHA512
|
||||
from .interface import ITCPReader, ITCPTransport, ITCPWriter
|
||||
from .security import TLS, TLSNoVerify, TLSVerifyHash, TLSVerifySHA512, tls_context
|
||||
|
||||
|
||||
class TCPReader(ITCPReader):
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import unittest
|
||||
|
||||
from ircrobots import glob
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue