add isort to project

This commit is contained in:
Istvan Ruzman
2020-08-17 08:03:57 +02:00
parent 10766b842c
commit e2c25d076d
11 changed files with 42 additions and 41 deletions

View File

@@ -3,16 +3,15 @@
"""Implementation of a simple but extensible RADIUS Client"""
from typing import cast, Optional, Union
from ipaddress import IPv4Address, IPv6Address
import select
import socket
import time
from ipaddress import IPv4Address, IPv6Address
from typing import Optional, Union, cast
import pyrad3.packet as P
from pyrad3.dictionary import Dictionary
from pyrad3 import host
from pyrad3.dictionary import Dictionary
SUPPORTED_SEND_TYPES = [
P.Code.AccessRequest,

View File

@@ -6,21 +6,11 @@
Classes and Types to parse and represent a RADIUS dictionary.
"""
from enum import IntEnum, Enum, auto
from dataclasses import dataclass
from os.path import dirname, isabs, join, normpath
from typing import (
Dict,
Generator,
IO,
List,
Optional,
Sequence,
Tuple,
Union,
)
import logging
from dataclasses import dataclass
from enum import Enum, IntEnum, auto
from os.path import dirname, isabs, join, normpath
from typing import IO, Dict, Generator, List, Optional, Sequence, Tuple, Union
LOG = logging.getLogger(__name__)

View File

@@ -3,8 +3,8 @@
"""Interface Class for RADIUS Clients and Servers"""
from pyrad3.dictionary import Dictionary
from pyrad3 import packet
from pyrad3.dictionary import Dictionary
class Host: # pylint: disable=too-many-arguments,too-many-instance-attributes

View File

@@ -3,23 +3,22 @@
"""Class for RADIUS Packet"""
import hashlib
import hmac
from collections import OrderedDict
from secrets import token_bytes
from typing import Any, Dict, Optional, Sequence, Tuple, Union
import hashlib
import hmac
from pyrad3.host import Host
from pyrad3.code import Code
from pyrad3.host import Host
from pyrad3.utils import (
PacketError,
Attribute,
parse_header,
parse_attributes,
PacketError,
calculate_authenticator,
validate_pap_password,
parse_attributes,
parse_header,
validate_chap_password,
validate_pap_password,
)
HMAC = hmac.new

View File

@@ -3,17 +3,16 @@
"""Collections of functions to en- and decode RADIUS Attributes"""
from typing import Optional, Union
import struct
from ipaddress import (
IPv4Address,
IPv4Network,
IPv6Address,
IPv6Network,
ip_network,
ip_address,
ip_network,
)
import struct
from typing import Optional, Union
def encode_string(string: str) -> bytes:

View File

@@ -3,15 +3,14 @@
"""Collection of functions to deal with RADIUS packet en- and decoding."""
from collections import namedtuple
from typing import List, Optional, Tuple, Union
import hashlib
import secrets
import struct
from collections import namedtuple
from typing import List, Optional, Tuple, Union
from pyrad3.dictionary import Dictionary
from pyrad3.code import Code
from pyrad3.dictionary import Dictionary
RANDOM_GENERATOR = secrets.SystemRandom()
MD5 = hashlib.md5