sort imports with isort

This commit is contained in:
A_D 2022-01-30 20:08:20 +02:00
parent 9b31aff951
commit 066f819e9c
No known key found for this signature in database
GPG key ID: 4BE9EB7DF45076C4
19 changed files with 93 additions and 70 deletions

View file

@ -1,11 +1,13 @@
import asyncio, re import asyncio
import re
from argparse import ArgumentParser from argparse import ArgumentParser
from typing import Dict, List, Optional 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 Bot as BaseBot
from ircrobots import Server as BaseServer
from ircrobots import ConnectionParams from ircrobots import ConnectionParams
from ircrobots import Server as BaseServer
TRIGGER = "!" TRIGGER = "!"

View file

@ -1,9 +1,11 @@
import asyncio 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 Bot as BaseBot
from ircrobots import ConnectionParams, SASLUserPass
from ircrobots import Server as BaseServer from ircrobots import Server as BaseServer
from ircrobots import ConnectionParams, SASLUserPass, SASLSCRAM
class Server(BaseServer): class Server(BaseServer):

View file

@ -1,9 +1,10 @@
import asyncio import asyncio
from irctokens import build, Line from irctokens import Line, build
from ircrobots import Bot as BaseBot from ircrobots import Bot as BaseBot
from ircrobots import Server as BaseServer
from ircrobots import ConnectionParams from ircrobots import ConnectionParams
from ircrobots import Server as BaseServer
SERVERS = [("freenode", "chat.freenode.invalid")] SERVERS = [("freenode", "chat.freenode.invalid")]

View file

@ -1,11 +1,11 @@
from .bot import Bot from .bot import Bot
from .server import Server
from .params import (
ConnectionParams,
SASLUserPass,
SASLExternal,
SASLSCRAM,
STSPolicy,
ResumePolicy,
)
from .ircv3 import Capability from .ircv3 import Capability
from .params import (
SASLSCRAM,
ConnectionParams,
ResumePolicy,
SASLExternal,
SASLUserPass,
STSPolicy,
)
from .server import Server

View file

@ -2,9 +2,10 @@ from asyncio import Future
from typing import Any, Awaitable, Callable, Generator, Generic, Optional, TypeVar from typing import Any, Awaitable, Callable, Generator, Generic, Optional, TypeVar
from irctokens import Line from irctokens import Line
from .matching import IMatchResponse
from .interface import IServer from .interface import IServer
from .ircv3 import TAG_LABEL from .ircv3 import TAG_LABEL
from .matching import IMatchResponse
TEvent = TypeVar("TEvent") TEvent = TypeVar("TEvent")

View file

@ -1,12 +1,13 @@
import asyncio, traceback import asyncio
import anyio import traceback
from typing import Dict from typing import Dict
import anyio
from ircstates.server import ServerDisconnectedException from ircstates.server import ServerDisconnectedException
from .interface import IBot, IServer, ITCPTransport
from .server import ConnectionParams, Server from .server import ConnectionParams, Server
from .transport import TCPTransport from .transport import TCPTransport
from .interface import IBot, IServer, ITCPTransport
class Bot(IBot): class Bot(IBot):

View file

@ -1,4 +1,5 @@
from dataclasses import dataclass from dataclasses import dataclass
from .interface import IServer from .interface import IServer

View file

@ -1,11 +1,11 @@
from asyncio import Future from asyncio import Future
from typing import Awaitable, Iterable, List, Optional, Set, Tuple, Union
from enum import IntEnum from enum import IntEnum
from typing import Awaitable, Iterable, List, Optional, Set, Tuple, Union
from ircstates import Server, Emit from ircstates import Emit, Server
from irctokens import Line, Hostmask from irctokens import Hostmask, Line
from .params import ConnectionParams, SASLParams, STSPolicy, ResumePolicy from .params import ConnectionParams, ResumePolicy, SASLParams, STSPolicy
from .security import TLS from .security import TLS

View file

@ -1,13 +1,14 @@
from dataclasses import dataclass
from time import time from time import time
from typing import Dict, Iterable, List, Optional, Tuple from typing import Dict, Iterable, List, Optional, Tuple
from dataclasses import dataclass
from irctokens import build
from ircstates.server import ServerDisconnectedException from ircstates.server import ServerDisconnectedException
from irctokens import build
from .contexts import ServerContext from .contexts import ServerContext
from .matching import Response, ANY
from .interface import ICapability 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 from .security import TLS_VERIFYCHAIN

View file

@ -1,2 +1,2 @@
from .responses import *
from .params import * from .params import *
from .responses import *

View file

@ -1,14 +1,17 @@
from re import compile as re_compile from re import compile as re_compile
from typing import Optional, Pattern, Union from typing import Optional, Pattern, Union
from irctokens import Hostmask from irctokens import Hostmask
from .. import formatting
from ..glob import Glob
from ..glob import compile as glob_compile
from ..interface import ( from ..interface import (
IMatchResponseHostmask,
IMatchResponseParam, IMatchResponseParam,
IMatchResponseValueParam, IMatchResponseValueParam,
IMatchResponseHostmask,
IServer, IServer,
) )
from ..glob import Glob, compile as glob_compile
from .. import formatting
class Any(IMatchResponseParam): class Any(IMatchResponseParam):

View file

@ -1,10 +1,12 @@
from typing import List, Optional, Sequence, Union from typing import List, Optional, Sequence, Union
from irctokens import Line from irctokens import Line
from ..interface import ( from ..interface import (
IServer,
IMatchResponse, IMatchResponse,
IMatchResponseParam,
IMatchResponseHostmask, IMatchResponseHostmask,
IMatchResponseParam,
IServer,
) )
from .params import * from .params import *

View file

@ -1,6 +1,6 @@
from dataclasses import dataclass, field
from re import compile as re_compile from re import compile as re_compile
from typing import List, Optional from typing import List, Optional
from dataclasses import dataclass, field
from .security import TLS, TLS_NOVERIFY, TLS_VERIFYCHAIN from .security import TLS, TLS_NOVERIFY, TLS_VERIFYCHAIN

View file

@ -1,13 +1,14 @@
from typing import List
from enum import Enum
from base64 import b64decode, b64encode from base64 import b64decode, b64encode
from irctokens import build from enum import Enum
from ircstates.numerics import * from typing import List
from ircstates.numerics import *
from irctokens import build
from .matching import Responses, Response, ANY
from .contexts import ServerContext from .contexts import ServerContext
from .params import SASLParams, SASLUserPass, SASLSCRAM, SASLExternal from .matching import ANY, Response, Responses
from .scram import SCRAMContext, SCRAMAlgorithm from .params import SASLSCRAM, SASLExternal, SASLParams, SASLUserPass
from .scram import SCRAMAlgorithm, SCRAMContext
SASL_SCRAM_MECHANISMS = [ SASL_SCRAM_MECHANISMS = [
"SCRAM-SHA-512", "SCRAM-SHA-512",

View file

@ -1,7 +1,11 @@
import base64, hashlib, hmac, os import base64
import hashlib
import hmac
import os
from enum import Enum from enum import Enum
from typing import Dict from typing import Dict
# IANA Hash Function Textual Names # IANA Hash Function Textual Names
# https://tools.ietf.org/html/rfc5802#section-4 # https://tools.ietf.org/html/rfc5802#section-4
# https://www.iana.org/assignments/hash-function-text-names/ # https://www.iana.org/assignments/hash-function-text-names/

View file

@ -1,5 +1,7 @@
import asyncio import asyncio
from asyncio import Future, PriorityQueue from asyncio import Future, PriorityQueue
from collections import deque
from time import monotonic
from typing import ( from typing import (
AsyncIterable, AsyncIterable,
Awaitable, Awaitable,
@ -12,42 +14,42 @@ from typing import (
Tuple, Tuple,
Union, Union,
) )
from collections import deque
from time import monotonic
import anyio import anyio
from async_timeout import timeout as timeout_
from asyncio_rlock import RLock from asyncio_rlock import RLock
from asyncio_throttle import Throttler from asyncio_throttle import Throttler
from async_timeout import timeout as timeout_ from ircstates import Channel, ChannelUser, Emit
from ircstates import Emit, Channel, ChannelUser from ircstates.names import Name
from ircstates.numerics import * from ircstates.numerics import *
from ircstates.server import ServerDisconnectedException from ircstates.server import ServerDisconnectedException
from ircstates.names import Name from irctokens import Line, build, tokenise
from irctokens import build, Line, 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 .asyncs import MaybeAwait, WaitFor
from .struct import Whois
from .params import ConnectionParams, SASLParams, STSPolicy, ResumePolicy
from .interface import ( from .interface import (
IBot, IBot,
ICapability, ICapability,
IServer,
SentLine,
SendPriority,
IMatchResponse, 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_RATE = 4 # lines
THROTTLE_TIME = 2 # seconds THROTTLE_TIME = 2 # seconds

View file

@ -1,5 +1,5 @@
from typing import List, Optional
from dataclasses import dataclass from dataclasses import dataclass
from typing import List, Optional
from ircstates import ChannelUser from ircstates import ChannelUser

View file

@ -1,11 +1,12 @@
from asyncio import StreamReader, StreamWriter
from hashlib import sha512 from hashlib import sha512
from ssl import SSLContext from ssl import SSLContext
from typing import Optional, Tuple from typing import Optional, Tuple
from asyncio import StreamReader, StreamWriter
from async_stagger import open_connection from async_stagger import open_connection
from .interface import ITCPTransport, ITCPReader, ITCPWriter from .interface import ITCPReader, ITCPTransport, ITCPWriter
from .security import tls_context, TLS, TLSNoVerify, TLSVerifyHash, TLSVerifySHA512 from .security import TLS, TLSNoVerify, TLSVerifyHash, TLSVerifySHA512, tls_context
class TCPReader(ITCPReader): class TCPReader(ITCPReader):

View file

@ -1,4 +1,5 @@
import unittest import unittest
from ircrobots import glob from ircrobots import glob