format: add isort to pre-commit and sort imports.

This commit is contained in:
UpstreamData
2022-11-10 14:15:45 -07:00
parent 228daecbbf
commit f3b25027ad
82 changed files with 226 additions and 258 deletions

View File

@@ -13,12 +13,12 @@
# limitations under the License. # limitations under the License.
import asyncio import asyncio
import json
import ipaddress import ipaddress
import warnings import json
import logging import logging
from typing import Union
import re import re
import warnings
from typing import Union
from pyasic.errors import APIError, APIWarning from pyasic.errors import APIError, APIWarning

View File

@@ -13,8 +13,7 @@
# limitations under the License. # limitations under the License.
import logging import logging
from pyasic.API import BaseMinerAPI from pyasic.API import APIError, BaseMinerAPI
from pyasic.API import APIError
class BMMinerAPI(BaseMinerAPI): class BMMinerAPI(BaseMinerAPI):

View File

@@ -13,22 +13,21 @@
# limitations under the License. # limitations under the License.
import asyncio import asyncio
import re
import json
import hashlib
import binascii
import base64 import base64
import binascii
import hashlib
import json
import logging import logging
import re
from typing import Union from typing import Union
from passlib.handlers.md5_crypt import md5_crypt
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from passlib.handlers.md5_crypt import md5_crypt
from pyasic.errors import APIError
from pyasic.API import BaseMinerAPI from pyasic.API import BaseMinerAPI
from pyasic.errors import APIError
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings
### IMPORTANT ### ### IMPORTANT ###
# you need to change the password of the miners using the Whatsminer # you need to change the password of the miners using the Whatsminer
# tool, then you can set them back to admin with this tool, but they # tool, then you can set them back to admin with this tool, but they

View File

@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.API import BaseMinerAPI, APIError
import logging import logging
from pyasic.API import APIError, BaseMinerAPI
class CGMinerAPI(BaseMinerAPI): class CGMinerAPI(BaseMinerAPI):
"""An abstraction of the CGMiner API. """An abstraction of the CGMiner API.

View File

@@ -16,26 +16,20 @@ from pyasic.API.bosminer import BOSMinerAPI
from pyasic.API.btminer import BTMinerAPI from pyasic.API.btminer import BTMinerAPI
from pyasic.API.cgminer import CGMinerAPI from pyasic.API.cgminer import CGMinerAPI
from pyasic.API.unknown import UnknownAPI from pyasic.API.unknown import UnknownAPI
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import ( from pyasic.data import (
MinerData,
BraiinsOSError, BraiinsOSError,
InnosiliconError, InnosiliconError,
MinerData,
WhatsminerError, WhatsminerError,
X19Error, X19Error,
) )
from pyasic.errors import APIError, APIWarning from pyasic.errors import APIError, APIWarning
from pyasic.miners import get_miner from pyasic.miners import get_miner
from pyasic.miners.base import AnyMiner from pyasic.miners.base import AnyMiner
from pyasic.miners.miner_factory import MinerFactory from pyasic.miners.miner_factory import MinerFactory
from pyasic.miners.miner_listener import MinerListener from pyasic.miners.miner_listener import MinerListener
from pyasic.network import MinerNetwork from pyasic.network import MinerNetwork
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings
__all__ = [ __all__ = [

View File

@@ -12,15 +12,15 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from dataclasses import dataclass, asdict, fields import json
from typing import Literal, List
import random import random
import string import string
import time
from dataclasses import asdict, dataclass, fields
from typing import List, Literal
import toml import toml
import yaml import yaml
import json
import time
@dataclass @dataclass

View File

@@ -12,15 +12,15 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from typing import Union, List import copy
from dataclasses import dataclass, field, asdict, fields import json
import time
from dataclasses import asdict, dataclass, field, fields
from datetime import datetime, timezone from datetime import datetime, timezone
from functools import reduce from functools import reduce
import time from typing import List, Union
import json
import copy
from .error_codes import X19Error, WhatsminerError, BraiinsOSError, InnosiliconError from .error_codes import BraiinsOSError, InnosiliconError, WhatsminerError, X19Error
@dataclass @dataclass

View File

@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from dataclasses import dataclass, asdict, fields from dataclasses import asdict, dataclass, fields
@dataclass @dataclass

View File

@@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .whatsminer import WhatsminerError
from .bos import BraiinsOSError
from .X19 import X19Error
from .innosilicon import InnosiliconError
from typing import TypeVar from typing import TypeVar
from .bos import BraiinsOSError
from .innosilicon import InnosiliconError
from .whatsminer import WhatsminerError
from .X19 import X19Error
MinerErrorData = TypeVar( MinerErrorData = TypeVar(
"MinerErrorData", WhatsminerError, BraiinsOSError, X19Error, InnosiliconError "MinerErrorData", WhatsminerError, BraiinsOSError, X19Error, InnosiliconError
) )

View File

@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from dataclasses import dataclass, asdict, fields from dataclasses import asdict, dataclass, fields
@dataclass @dataclass

View File

@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from dataclasses import dataclass, field, asdict, fields from dataclasses import asdict, dataclass, field, fields
@dataclass @dataclass

View File

@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from dataclasses import dataclass, field, asdict, fields from dataclasses import asdict, dataclass, field, fields
@dataclass @dataclass

View File

@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
import logging import logging
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings

View File

@@ -15,9 +15,10 @@
import ipaddress import ipaddress
from typing import Union from typing import Union
from pyasic.miners.base import BaseMiner, AnyMiner from pyasic.miners.base import AnyMiner, BaseMiner
from pyasic.miners.miner_factory import MinerFactory from pyasic.miners.miner_factory import MinerFactory
# abstracted version of get miner that is easier to access # abstracted version of get miner that is easier to access
async def get_miner(ip: Union[ipaddress.ip_address, str]) -> AnyMiner: async def get_miner(ip: Union[ipaddress.ip_address, str]) -> AnyMiner:
return await MinerFactory().get_miner(ip) return await MinerFactory().get_miner(ip)

View File

@@ -14,16 +14,13 @@
import ipaddress import ipaddress
import logging import logging
from typing import Union, List from typing import List, Union
from pyasic.API.bmminer import BMMinerAPI from pyasic.API.bmminer import BMMinerAPI
from pyasic.miners.base import BaseMiner
from pyasic.data import MinerData, HashBoard
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import HashBoard, MinerData
from pyasic.data.error_codes import MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.miners.base import BaseMiner
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings

View File

@@ -13,22 +13,18 @@
# limitations under the License. # limitations under the License.
import ipaddress import ipaddress
import logging
import json import json
from typing import Union, List import logging
from typing import List, Union
import toml import toml
from pyasic.miners.base import BaseMiner
from pyasic.API.bosminer import BOSMinerAPI from pyasic.API.bosminer import BOSMinerAPI
from pyasic.errors import APIError
from pyasic.data.error_codes import BraiinsOSError, MinerErrorData
from pyasic.data import MinerData, HashBoard
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import HashBoard, MinerData
from pyasic.data.error_codes import BraiinsOSError, MinerErrorData
from pyasic.errors import APIError
from pyasic.miners.base import BaseMiner
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings

View File

@@ -12,16 +12,15 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import logging
import ipaddress import ipaddress
from typing import Union, List import logging
from typing import List, Union
from pyasic.API.bosminer import BOSMinerAPI from pyasic.API.bosminer import BOSMinerAPI
from pyasic.miners.base import BaseMiner
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import MinerData from pyasic.data import MinerData
from pyasic.data.error_codes import MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.miners.base import BaseMiner
class BOSMinerOld(BaseMiner): class BOSMinerOld(BaseMiner):

View File

@@ -14,17 +14,14 @@
import ipaddress import ipaddress
import logging import logging
from typing import Union, List from typing import List, Union
from pyasic.API.btminer import BTMinerAPI from pyasic.API.btminer import BTMinerAPI
from pyasic.miners.base import BaseMiner
from pyasic.errors import APIError
from pyasic.data import MinerData, HashBoard
from pyasic.data.error_codes import WhatsminerError, MinerErrorData
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import HashBoard, MinerData
from pyasic.data.error_codes import MinerErrorData, WhatsminerError
from pyasic.errors import APIError
from pyasic.miners.base import BaseMiner
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings

View File

@@ -14,17 +14,14 @@
import ipaddress import ipaddress
import logging import logging
from typing import Union, List from typing import List, Union
from pyasic.API.cgminer import CGMinerAPI from pyasic.API.cgminer import CGMinerAPI
from pyasic.miners.base import BaseMiner
from pyasic.errors import APIError
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import HashBoard, MinerData
from pyasic.data import MinerData, HashBoard
from pyasic.data.error_codes import MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.errors import APIError
from pyasic.miners.base import BaseMiner
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BMMiner
import ipaddress import ipaddress
from pyasic.miners._backends import BMMiner
class Hiveon(BMMiner): class Hiveon(BMMiner):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -14,5 +14,5 @@
from .antminer import * from .antminer import *
from .avalonminer import * from .avalonminer import *
from .whatsminer import *
from .innosilicon import * from .innosilicon import *
from .whatsminer import *

View File

@@ -16,7 +16,6 @@ from .S17 import S17
from .S17_Plus import S17Plus from .S17_Plus import S17Plus
from .S17_Pro import S17Pro from .S17_Pro import S17Pro
from .S17e import S17e from .S17e import S17e
from .T17 import T17 from .T17 import T17
from .T17_Plus import T17Plus from .T17_Plus import T17Plus
from .T17e import T17e from .T17e import T17e

View File

@@ -14,12 +14,8 @@
from .S19 import S19 from .S19 import S19
from .S19_Pro import S19Pro from .S19_Pro import S19Pro
from .S19_XP import S19XP
from .S19a import S19a
from .S19j import S19j from .S19j import S19j
from .S19j_Pro import S19jPro from .S19j_Pro import S19jPro
from .S19_XP import S19XP
from .S19a import S19a
from .T19 import T19 from .T19 import T19

View File

@@ -15,7 +15,6 @@
from .M20 import M20, M20V10 from .M20 import M20, M20V10
from .M20S import M20S, M20SV10, M20SV20 from .M20S import M20S, M20SV10, M20SV20
from .M20S_Plus import M20SPlus from .M20S_Plus import M20SPlus
from .M21 import M21 from .M21 import M21
from .M21S import M21S, M21SV20, M21SV60 from .M21S import M21S, M21SV20, M21SV60
from .M21S_Plus import M21SPlus from .M21S_Plus import M21SPlus

View File

@@ -12,26 +12,24 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .M30S import M30S, M30SVE10, M30SVE20, M30SVG20, M30SV50 from .M30S import M30S, M30SV50, M30SVE10, M30SVE20, M30SVG20
from .M30S_Plus import M30SPlus, M30SPlusVG60, M30SPlusVE40, M30SPlusVF20 from .M30S_Plus import M30SPlus, M30SPlusVE40, M30SPlusVF20, M30SPlusVG60
from .M30S_Plus_Plus import ( from .M30S_Plus_Plus import (
M30SPlusPlus, M30SPlusPlus,
M30SPlusPlusVG30, M30SPlusPlusVG30,
M30SPlusPlusVG40, M30SPlusPlusVG40,
M30SPlusPlusVH60, M30SPlusPlusVH60,
) )
from .M31S import M31S from .M31S import M31S
from .M31S_Plus import ( from .M31S_Plus import (
M31SPlus, M31SPlus,
M31SPlusVE20,
M31SPlusV30, M31SPlusV30,
M31SPlusV40, M31SPlusV40,
M31SPlusV80,
M31SPlusV60, M31SPlusV60,
M31SPlusV80,
M31SPlusV90, M31SPlusV90,
M31SPlusVE20,
) )
from .M32 import M32, M32V20 from .M32 import M32, M32V20
from .M32S import M32S from .M32S import M32S
from .M34S_Plus import M34SPlus, M34SPlusVE10 from .M34S_Plus import M34SPlus, M34SPlusVE10

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X17 import BMMinerX17
from pyasic.miners._types import S17 # noqa - Ignore access to _module from pyasic.miners._types import S17 # noqa - Ignore access to _module
from .X17 import BMMinerX17
class BMMinerS17(BMMinerX17, S17): class BMMinerS17(BMMinerX17, S17):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X17 import BMMinerX17
from pyasic.miners._types import S17Plus # noqa - Ignore access to _module from pyasic.miners._types import S17Plus # noqa - Ignore access to _module
from .X17 import BMMinerX17
class BMMinerS17Plus(BMMinerX17, S17Plus): class BMMinerS17Plus(BMMinerX17, S17Plus):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X17 import BMMinerX17
from pyasic.miners._types import S17Pro # noqa - Ignore access to _module from pyasic.miners._types import S17Pro # noqa - Ignore access to _module
from .X17 import BMMinerX17
class BMMinerS17Pro(BMMinerX17, S17Pro): class BMMinerS17Pro(BMMinerX17, S17Pro):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X17 import BMMinerX17
from pyasic.miners._types import S17e # noqa - Ignore access to _module from pyasic.miners._types import S17e # noqa - Ignore access to _module
from .X17 import BMMinerX17
class BMMinerS17e(BMMinerX17, S17e): class BMMinerS17e(BMMinerX17, S17e):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X17 import BMMinerX17
from pyasic.miners._types import T17 # noqa - Ignore access to _module from pyasic.miners._types import T17 # noqa - Ignore access to _module
from .X17 import BMMinerX17
class BMMinerT17(BMMinerX17, T17): class BMMinerT17(BMMinerX17, T17):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X17 import BMMinerX17
from pyasic.miners._types import T17Plus # noqa - Ignore access to _module from pyasic.miners._types import T17Plus # noqa - Ignore access to _module
from .X17 import BMMinerX17
class BMMinerT17Plus(BMMinerX17, T17Plus): class BMMinerT17Plus(BMMinerX17, T17Plus):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X17 import BMMinerX17
from pyasic.miners._types import T17e # noqa - Ignore access to _module from pyasic.miners._types import T17e # noqa - Ignore access to _module
from .X17 import BMMinerX17
class BMMinerT17e(BMMinerX17, T17e): class BMMinerT17e(BMMinerX17, T17e):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BMMiner # noqa - Ignore access to _module from typing import Union
from pyasic.settings import PyasicSettings
import httpx import httpx
from typing import Union
from pyasic.miners._backends import BMMiner # noqa - Ignore access to _module
from pyasic.settings import PyasicSettings
class BMMinerX17(BMMiner): class BMMinerX17(BMMiner):

View File

@@ -16,7 +16,6 @@ from .S17 import BMMinerS17
from .S17_Plus import BMMinerS17Plus from .S17_Plus import BMMinerS17Plus
from .S17_Pro import BMMinerS17Pro from .S17_Pro import BMMinerS17Pro
from .S17e import BMMinerS17e from .S17e import BMMinerS17e
from .T17 import BMMinerT17 from .T17 import BMMinerT17
from .T17_Plus import BMMinerT17Plus from .T17_Plus import BMMinerT17Plus
from .T17e import BMMinerT17e from .T17e import BMMinerT17e

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X19 import BMMinerX19
from pyasic.miners._types import S19 # noqa - Ignore access to _module from pyasic.miners._types import S19 # noqa - Ignore access to _module
from .X19 import BMMinerX19
class BMMinerS19(BMMinerX19, S19): class BMMinerS19(BMMinerX19, S19):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X19 import BMMinerX19
from pyasic.miners._types import S19Pro # noqa - Ignore access to _module from pyasic.miners._types import S19Pro # noqa - Ignore access to _module
from .X19 import BMMinerX19
class BMMinerS19Pro(BMMinerX19, S19Pro): class BMMinerS19Pro(BMMinerX19, S19Pro):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X19 import BMMinerX19
from pyasic.miners._types import S19XP # noqa - Ignore access to _module from pyasic.miners._types import S19XP # noqa - Ignore access to _module
from .X19 import BMMinerX19
class BMMinerS19XP(BMMinerX19, S19XP): class BMMinerS19XP(BMMinerX19, S19XP):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X19 import BMMinerX19
from pyasic.miners._types import S19a # noqa - Ignore access to _module from pyasic.miners._types import S19a # noqa - Ignore access to _module
from .X19 import BMMinerX19
class BMMinerS19a(BMMinerX19, S19a): class BMMinerS19a(BMMinerX19, S19a):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X19 import BMMinerX19
from pyasic.miners._types import S19j # noqa - Ignore access to _module from pyasic.miners._types import S19j # noqa - Ignore access to _module
from .X19 import BMMinerX19
class BMMinerS19j(BMMinerX19, S19j): class BMMinerS19j(BMMinerX19, S19j):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X19 import BMMinerX19
from pyasic.miners._types import S19jPro # noqa - Ignore access to _module from pyasic.miners._types import S19jPro # noqa - Ignore access to _module
from .X19 import BMMinerX19
class BMMinerS19jPro(BMMinerX19, S19jPro): class BMMinerS19jPro(BMMinerX19, S19jPro):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .X19 import BMMinerX19
from pyasic.miners._types import T19 # noqa - Ignore access to _module from pyasic.miners._types import T19 # noqa - Ignore access to _module
from .X19 import BMMinerX19
class BMMinerT19(BMMinerX19, T19): class BMMinerT19(BMMinerX19, T19):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,16 +12,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BMMiner # noqa - Ignore access to _module import asyncio
import json
from pyasic.config import MinerConfig from typing import List, Union
from pyasic.data.error_codes import X19Error, MinerErrorData
from pyasic.settings import PyasicSettings
import httpx import httpx
import json
import asyncio from pyasic.config import MinerConfig
from typing import Union, List from pyasic.data.error_codes import MinerErrorData, X19Error
from pyasic.miners._backends import BMMiner # noqa - Ignore access to _module
from pyasic.settings import PyasicSettings
class BMMinerX19(BMMiner): class BMMinerX19(BMMiner):

View File

@@ -14,12 +14,8 @@
from .S19 import BMMinerS19 from .S19 import BMMinerS19
from .S19_Pro import BMMinerS19Pro from .S19_Pro import BMMinerS19Pro
from .S19_XP import BMMinerS19XP
from .S19a import BMMinerS19a
from .S19j import BMMinerS19j from .S19j import BMMinerS19j
from .S19j_Pro import BMMinerS19jPro from .S19j_Pro import BMMinerS19jPro
from .S19_XP import BMMinerS19XP
from .S19a import BMMinerS19a
from .T19 import BMMinerT19 from .T19 import BMMinerT19

View File

@@ -16,7 +16,6 @@ from .S17 import BOSMinerS17
from .S17_Plus import BOSMinerS17Plus from .S17_Plus import BOSMinerS17Plus
from .S17_Pro import BOSMinerS17Pro from .S17_Pro import BOSMinerS17Pro
from .S17e import BOSMinerS17e from .S17e import BOSMinerS17e
from .T17 import BOSMinerT17 from .T17 import BOSMinerT17
from .T17_Plus import BOSMinerT17Plus from .T17_Plus import BOSMinerT17Plus
from .T17e import BOSMinerT17e from .T17e import BOSMinerT17e

View File

@@ -14,8 +14,6 @@
from .S19 import BOSMinerS19 from .S19 import BOSMinerS19
from .S19_Pro import BOSMinerS19Pro from .S19_Pro import BOSMinerS19Pro
from .S19j import BOSMinerS19j from .S19j import BOSMinerS19j
from .S19j_Pro import BOSMinerS19jPro from .S19j_Pro import BOSMinerS19jPro
from .T19 import BOSMinerT19 from .T19 import BOSMinerT19

View File

@@ -16,7 +16,6 @@ from .S17 import CGMinerS17
from .S17_Plus import CGMinerS17Plus from .S17_Plus import CGMinerS17Plus
from .S17_Pro import CGMinerS17Pro from .S17_Pro import CGMinerS17Pro
from .S17e import CGMinerS17e from .S17e import CGMinerS17e
from .T17 import CGMinerT17 from .T17 import CGMinerT17
from .T17_Plus import CGMinerT17Plus from .T17_Plus import CGMinerT17Plus
from .T17e import CGMinerT17e from .T17e import CGMinerT17e

View File

@@ -14,8 +14,6 @@
from .S19 import CGMinerS19 from .S19 import CGMinerS19
from .S19_Pro import CGMinerS19Pro from .S19_Pro import CGMinerS19Pro
from .S19j import CGMinerS19j from .S19j import CGMinerS19j
from .S19j_Pro import CGMinerS19jPro from .S19j_Pro import CGMinerS19jPro
from .T19 import CGMinerT19 from .T19 import CGMinerT19

View File

@@ -12,10 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.data import HashBoard, MinerData
from pyasic.miners._backends import Hiveon # noqa - Ignore access to _module from pyasic.miners._backends import Hiveon # noqa - Ignore access to _module
from pyasic.miners._types import T9 # noqa - Ignore access to _module from pyasic.miners._types import T9 # noqa - Ignore access to _module
from pyasic.data import MinerData, HashBoard
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A10X import CGMinerA10X
from pyasic.miners._types import Avalon1026 # noqa - Ignore access to _module from pyasic.miners._types import Avalon1026 # noqa - Ignore access to _module
from .A10X import CGMinerA10X
class CGMinerAvalon1026(CGMinerA10X, Avalon1026): class CGMinerAvalon1026(CGMinerA10X, Avalon1026):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A10X import CGMinerA10X
from pyasic.miners._types import Avalon1047 # noqa - Ignore access to _module from pyasic.miners._types import Avalon1047 # noqa - Ignore access to _module
from .A10X import CGMinerA10X
class CGMinerAvalon1047(CGMinerA10X, Avalon1047): class CGMinerAvalon1047(CGMinerA10X, Avalon1047):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A10X import CGMinerA10X
from pyasic.miners._types import Avalon1066 # noqa - Ignore access to _module from pyasic.miners._types import Avalon1066 # noqa - Ignore access to _module
from .A10X import CGMinerA10X
class CGMinerAvalon1066(CGMinerA10X, Avalon1066): class CGMinerAvalon1066(CGMinerA10X, Avalon1066):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module
from pyasic.data import MinerData, HashBoard
from pyasic.settings import PyasicSettings
import re
from pyasic.config import MinerConfig
import logging import logging
import re
from pyasic.config import MinerConfig
from pyasic.data import HashBoard, MinerData
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module
from pyasic.settings import PyasicSettings
class CGMinerA10X(CGMiner): class CGMinerA10X(CGMiner):

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A7X import CGMinerA7X # noqa - Ignore access to _module
from pyasic.miners._types import Avalon721 # noqa - Ignore access to _module from pyasic.miners._types import Avalon721 # noqa - Ignore access to _module
from .A7X import CGMinerA7X # noqa - Ignore access to _module
class CGMinerAvalon721(CGMinerA7X, Avalon721): class CGMinerAvalon721(CGMinerA7X, Avalon721):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A7X import CGMinerA7X # noqa - Ignore access to _module
from pyasic.miners._types import Avalon741 # noqa - Ignore access to _module from pyasic.miners._types import Avalon741 # noqa - Ignore access to _module
from .A7X import CGMinerA7X # noqa - Ignore access to _module
class CGMinerAvalon741(CGMinerA7X, Avalon741): class CGMinerAvalon741(CGMinerA7X, Avalon741):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A7X import CGMinerA7X # noqa - Ignore access to _module
from pyasic.miners._types import Avalon761 # noqa - Ignore access to _module from pyasic.miners._types import Avalon761 # noqa - Ignore access to _module
from .A7X import CGMinerA7X # noqa - Ignore access to _module
class CGMinerAvalon761(CGMinerA7X, Avalon761): class CGMinerAvalon761(CGMinerA7X, Avalon761):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module
from pyasic.data import MinerData, HashBoard
from pyasic.settings import PyasicSettings
import re
from pyasic.config import MinerConfig
import logging import logging
import re
from pyasic.config import MinerConfig
from pyasic.data import HashBoard, MinerData
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module
from pyasic.settings import PyasicSettings
class CGMinerA7X(CGMiner): class CGMinerA7X(CGMiner):

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A8X import CGMinerA8X # noqa - Ignore access to _module
from pyasic.miners._types import Avalon821 # noqa - Ignore access to _module from pyasic.miners._types import Avalon821 # noqa - Ignore access to _module
from .A8X import CGMinerA8X # noqa - Ignore access to _module
class CGMinerAvalon821(CGMinerA8X, Avalon821): class CGMinerAvalon821(CGMinerA8X, Avalon821):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A8X import CGMinerA8X # noqa - Ignore access to _module
from pyasic.miners._types import Avalon841 # noqa - Ignore access to _module from pyasic.miners._types import Avalon841 # noqa - Ignore access to _module
from .A8X import CGMinerA8X # noqa - Ignore access to _module
class CGMinerAvalon841(CGMinerA8X, Avalon841): class CGMinerAvalon841(CGMinerA8X, Avalon841):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .A8X import CGMinerA8X # noqa - Ignore access to _module
from pyasic.miners._types import Avalon851 # noqa - Ignore access to _module from pyasic.miners._types import Avalon851 # noqa - Ignore access to _module
from .A8X import CGMinerA8X # noqa - Ignore access to _module
class CGMinerAvalon851(CGMinerA8X, Avalon851): class CGMinerAvalon851(CGMinerA8X, Avalon851):
def __init__(self, ip: str) -> None: def __init__(self, ip: str) -> None:

View File

@@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module
from pyasic.data import MinerData, HashBoard
from pyasic.settings import PyasicSettings
import re
from pyasic.config import MinerConfig
import logging import logging
import re
from pyasic.config import MinerConfig
from pyasic.data import HashBoard, MinerData
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module
from pyasic.settings import PyasicSettings
class CGMinerA8X(CGMiner): class CGMinerA8X(CGMiner):

View File

@@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import logging
import re
from pyasic.config import MinerConfig
from pyasic.data import HashBoard, MinerData
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module
from pyasic.miners._types import Avalon921 # noqa - Ignore access to _module from pyasic.miners._types import Avalon921 # noqa - Ignore access to _module
from pyasic.data import MinerData, HashBoard
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings
import re
from pyasic.config import MinerConfig
import logging
class CGMinerAvalon921(CGMiner, Avalon921): class CGMinerAvalon921(CGMiner, Avalon921):

View File

@@ -12,20 +12,21 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import asyncssh
import logging
import ipaddress import ipaddress
import logging
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import TypeVar, List, Union from typing import List, TypeVar, Union
import asyncssh
from pyasic.data import MinerData
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import MinerData
from pyasic.data.error_codes import ( from pyasic.data.error_codes import (
WhatsminerError,
BraiinsOSError, BraiinsOSError,
InnosiliconError, InnosiliconError,
X19Error,
MinerErrorData, MinerErrorData,
WhatsminerError,
X19Error,
) )

View File

@@ -12,18 +12,19 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module import logging
from pyasic.miners._types import InnosiliconT3HPlus # noqa - Ignore access to _module import warnings
from pyasic.data import MinerData, HashBoard from typing import List, Union
from pyasic.data.error_codes import InnosiliconError, MinerErrorData
from pyasic.settings import PyasicSettings
from pyasic.config import MinerConfig
from pyasic.errors import APIError
import httpx import httpx
import warnings
from typing import Union, List from pyasic.config import MinerConfig
import logging from pyasic.data import HashBoard, MinerData
from pyasic.data.error_codes import InnosiliconError, MinerErrorData
from pyasic.errors import APIError
from pyasic.miners._backends import CGMiner # noqa - Ignore access to _module
from pyasic.miners._types import InnosiliconT3HPlus # noqa - Ignore access to _module
from pyasic.settings import PyasicSettings
class CGMinerInnosiliconT3HPlus(CGMiner, InnosiliconT3HPlus): class CGMinerInnosiliconT3HPlus(CGMiner, InnosiliconT3HPlus):

View File

@@ -12,38 +12,32 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from typing import Tuple, List, Union
from collections.abc import AsyncIterable
from pyasic.miners.base import AnyMiner
import httpx
from pyasic.miners.antminer import *
from pyasic.miners.avalonminer import *
from pyasic.miners.whatsminer import *
from pyasic.miners.innosilicon import *
from pyasic.miners._backends.cgminer import CGMiner # noqa - Ignore _module import
from pyasic.miners._backends.bmminer import BMMiner # noqa - Ignore _module import
from pyasic.miners._backends.bosminer import BOSMiner # noqa - Ignore _module import
from pyasic.miners._backends.btminer import BTMiner # noqa - Ignore _module import
from pyasic.miners._backends.bosminer_old import ( # noqa - Ignore _module import
BOSMinerOld,
)
from pyasic.miners.unknown import UnknownMiner
from pyasic.errors import APIError
from pyasic.misc import Singleton
import asyncio import asyncio
import ipaddress import ipaddress
import json import json
import logging import logging
from collections.abc import AsyncIterable
from pyasic.settings import PyasicSettings from typing import List, Tuple, Union
import asyncssh import asyncssh
import httpx
from pyasic.errors import APIError
from pyasic.miners._backends.bmminer import BMMiner # noqa - Ignore _module import
from pyasic.miners._backends.bosminer import BOSMiner # noqa - Ignore _module import
from pyasic.miners._backends.bosminer_old import ( # noqa - Ignore _module import
BOSMinerOld,
)
from pyasic.miners._backends.btminer import BTMiner # noqa - Ignore _module import
from pyasic.miners._backends.cgminer import CGMiner # noqa - Ignore _module import
from pyasic.miners.antminer import *
from pyasic.miners.avalonminer import *
from pyasic.miners.base import AnyMiner
from pyasic.miners.innosilicon import *
from pyasic.miners.unknown import UnknownMiner
from pyasic.miners.whatsminer import *
from pyasic.misc import Singleton
from pyasic.settings import PyasicSettings
MINER_CLASSES = { MINER_CLASSES = {
"ANTMINER S9": { "ANTMINER S9": {

View File

@@ -15,10 +15,10 @@
from typing import List from typing import List
from pyasic.API.unknown import UnknownAPI from pyasic.API.unknown import UnknownAPI
from pyasic.miners.base import BaseMiner
from pyasic.config import MinerConfig from pyasic.config import MinerConfig
from pyasic.data import MinerData from pyasic.data import MinerData
from pyasic.data.error_codes import MinerErrorData from pyasic.data.error_codes import MinerErrorData
from pyasic.miners.base import BaseMiner
class UnknownMiner(BaseMiner): class UnknownMiner(BaseMiner):

View File

@@ -13,10 +13,7 @@
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module
from pyasic.miners._types import ( # noqa - Ignore access to _module from pyasic.miners._types import M20, M20V10 # noqa - Ignore access to _module
M20,
M20V10,
)
class BTMinerM20(BTMiner, M20): class BTMinerM20(BTMiner, M20):

View File

@@ -13,11 +13,11 @@
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module
from pyasic.miners._types import ( from pyasic.miners._types import ( # noqa - Ignore access to _module
M21S, M21S,
M21SV20, M21SV20,
M21SV60, M21SV60,
) # noqa - Ignore access to _module )
class BTMinerM21S(BTMiner, M21S): class BTMinerM21S(BTMiner, M21S):

View File

@@ -15,7 +15,6 @@
from .M20 import BTMinerM20, BTMinerM20V10 from .M20 import BTMinerM20, BTMinerM20V10
from .M20S import BTMinerM20S, BTMinerM20SV10, BTMinerM20SV20 from .M20S import BTMinerM20S, BTMinerM20SV10, BTMinerM20SV20
from .M20S_Plus import BTMinerM20SPlus from .M20S_Plus import BTMinerM20SPlus
from .M21 import BTMinerM21 from .M21 import BTMinerM21
from .M21S import BTMinerM21S, BTMinerM21SV20, BTMinerM21SV60 from .M21S import BTMinerM21S, BTMinerM21SV20, BTMinerM21SV60
from .M21S_Plus import BTMinerM21SPlus from .M21S_Plus import BTMinerM21SPlus

View File

@@ -13,13 +13,13 @@
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module
from pyasic.miners._types import ( from pyasic.miners._types import ( # noqa - Ignore access to _module
M30S, M30S,
M30SV50, M30SV50,
M30SVG20,
M30SVE20,
M30SVE10, M30SVE10,
) # noqa - Ignore access to _module M30SVE20,
M30SVG20,
)
class BTMinerM30S(BTMiner, M30S): class BTMinerM30S(BTMiner, M30S):

View File

@@ -13,12 +13,12 @@
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module
from pyasic.miners._types import ( from pyasic.miners._types import ( # noqa - Ignore access to _module
M30SPlus, M30SPlus,
M30SPlusVE40, M30SPlusVE40,
M30SPlusVF20, M30SPlusVF20,
M30SPlusVG60, M30SPlusVG60,
) # noqa - Ignore access to _module )
class BTMinerM30SPlus(BTMiner, M30SPlus): class BTMinerM30SPlus(BTMiner, M30SPlus):

View File

@@ -15,8 +15,8 @@
from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module
from pyasic.miners._types import ( # noqa - Ignore access to _module from pyasic.miners._types import ( # noqa - Ignore access to _module
M30SPlusPlus, M30SPlusPlus,
M30SPlusPlusVG40,
M30SPlusPlusVG30, M30SPlusPlusVG30,
M30SPlusPlusVG40,
M30SPlusPlusVH60, M30SPlusPlusVH60,
) )

View File

@@ -13,15 +13,15 @@
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module
from pyasic.miners._types import ( from pyasic.miners._types import ( # noqa - Ignore access to _module
M31SPlus, M31SPlus,
M31SPlusVE20,
M31SPlusV30, M31SPlusV30,
M31SPlusV40, M31SPlusV40,
M31SPlusV60, M31SPlusV60,
M31SPlusV80, M31SPlusV80,
M31SPlusV90, M31SPlusV90,
) # noqa - Ignore access to _module M31SPlusVE20,
)
class BTMinerM31SPlus(BTMiner, M31SPlus): class BTMinerM31SPlus(BTMiner, M31SPlus):

View File

@@ -13,9 +13,7 @@
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module
from pyasic.miners._types import ( from pyasic.miners._types import M32S # noqa - Ignore access to _module
M32S,
) # noqa - Ignore access to _module
class BTMinerM32S(BTMiner, M32S): class BTMinerM32S(BTMiner, M32S):

View File

@@ -13,10 +13,10 @@
# limitations under the License. # limitations under the License.
from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module from pyasic.miners._backends import BTMiner # noqa - Ignore access to _module
from pyasic.miners._types import ( from pyasic.miners._types import ( # noqa - Ignore access to _module
M34SPlus, M34SPlus,
M34SPlusVE10, M34SPlusVE10,
) # noqa - Ignore access to _module )
class BTMinerM34SPlus(BTMiner, M34SPlus): class BTMinerM34SPlus(BTMiner, M34SPlus):

View File

@@ -14,35 +14,33 @@
from .M30S import ( from .M30S import (
BTMinerM30S, BTMinerM30S,
BTMinerM30SV50,
BTMinerM30SVE10, BTMinerM30SVE10,
BTMinerM30SVE20, BTMinerM30SVE20,
BTMinerM30SVG20, BTMinerM30SVG20,
BTMinerM30SV50,
) )
from .M30S_Plus import ( from .M30S_Plus import (
BTMinerM30SPlus, BTMinerM30SPlus,
BTMinerM30SPlusVF20,
BTMinerM30SPlusVE40, BTMinerM30SPlusVE40,
BTMinerM30SPlusVF20,
BTMinerM30SPlusVG60, BTMinerM30SPlusVG60,
) )
from .M30S_Plus_Plus import ( from .M30S_Plus_Plus import (
BTMinerM30SPlusPlus, BTMinerM30SPlusPlus,
BTMinerM30SPlusPlusVG40,
BTMinerM30SPlusPlusVG30, BTMinerM30SPlusPlusVG30,
BTMinerM30SPlusPlusVG40,
BTMinerM30SPlusPlusVH60, BTMinerM30SPlusPlusVH60,
) )
from .M31S import BTMinerM31S from .M31S import BTMinerM31S
from .M31S_Plus import ( from .M31S_Plus import (
BTMinerM31SPlus, BTMinerM31SPlus,
BTMinerM31SPlusVE20,
BTMinerM31SPlusV30, BTMinerM31SPlusV30,
BTMinerM31SPlusV40, BTMinerM31SPlusV40,
BTMinerM31SPlusV60, BTMinerM31SPlusV60,
BTMinerM31SPlusV80, BTMinerM31SPlusV80,
BTMinerM31SPlusV90, BTMinerM31SPlusV90,
BTMinerM31SPlusVE20,
) )
from .M32 import BTMinerM32, BTMinerM32V20 from .M32 import BTMinerM32, BTMinerM32V20
from .M32S import BTMinerM32S from .M32S import BTMinerM32S
from .M34S_Plus import BTMinerM34SPlus, BTMinerM34SPlusVE10 from .M34S_Plus import BTMinerM34SPlus, BTMinerM34SPlusVE10

View File

@@ -12,7 +12,4 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .M50 import ( from .M50 import BTMinerM50, BTMinerM50VH50
BTMinerM50,
BTMinerM50VH50,
)

View File

@@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import ipaddress
import asyncio import asyncio
import ipaddress
import logging import logging
from typing import Union, List, AsyncIterator from typing import AsyncIterator, List, Union
from pyasic.miners.miner_factory import AnyMiner, MinerFactory
from pyasic.network.net_range import MinerNetworkRange from pyasic.network.net_range import MinerNetworkRange
from pyasic.miners.miner_factory import MinerFactory, AnyMiner
from pyasic.settings import PyasicSettings from pyasic.settings import PyasicSettings

View File

@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from typing import Union
import ipaddress import ipaddress
from typing import Union
class MinerNetworkRange: class MinerNetworkRange:

View File

@@ -13,9 +13,10 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
from tests.miners_tests import MinersTest, MinerFactoryTest
from tests.network_tests import NetworkTest
from tests.config_tests import ConfigTest from tests.config_tests import ConfigTest
from tests.miners_tests import MinerFactoryTest, MinersTest
from tests.network_tests import NetworkTest
if __name__ == "__main__": if __name__ == "__main__":
# `coverage run --source pyasic -m unittest discover` will give code coverage data # `coverage run --source pyasic -m unittest discover` will give code coverage data

View File

@@ -13,14 +13,15 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
from pyasic.config import MinerConfig, _PoolGroup, _Pool # noqa
from tests.test_data import ( from tests.test_data import (
bosminer_api_pools, bosminer_api_pools,
bosminer_config_pools,
x19_api_pools, x19_api_pools,
x19_web_pools, x19_web_pools,
bosminer_config_pools,
) )
from pyasic.config import MinerConfig, _Pool, _PoolGroup # noqa
class ConfigTest(unittest.TestCase): class ConfigTest(unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:

View File

@@ -11,18 +11,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import unittest
from pyasic.miners.miner_factory import MINER_CLASSES
from pyasic.miners.base import BaseMiner
from pyasic.miners._backends import CGMiner
from pyasic.miners.miner_factory import MinerFactory
from pyasic.miners.miner_listener import MinerListener
import asyncio import asyncio
import inspect import inspect
import sys import sys
import unittest
from pyasic.miners._backends import CGMiner
from pyasic.miners.base import BaseMiner
from pyasic.miners.miner_factory import MINER_CLASSES, MinerFactory
from pyasic.miners.miner_listener import MinerListener
class MinersTest(unittest.TestCase): class MinersTest(unittest.TestCase):

View File

@@ -15,8 +15,8 @@
import ipaddress import ipaddress
import unittest import unittest
from pyasic.network.net_range import MinerNetworkRange
from pyasic.network import MinerNetwork from pyasic.network import MinerNetwork
from pyasic.network.net_range import MinerNetworkRange
class NetworkTest(unittest.TestCase): class NetworkTest(unittest.TestCase):