fixed some bugs on linux with pipes
This commit is contained in:
@@ -137,7 +137,7 @@ If you are sure you want to use this command please use API.send_command("{item}
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def validate_command_output(data: dict) -> tuple[bool, str | None]:
|
def validate_command_output(data: dict) -> tuple:
|
||||||
"""Check if the returned command output is correctly formatted."""
|
"""Check if the returned command output is correctly formatted."""
|
||||||
# check if the data returned is correct or an error
|
# check if the data returned is correct or an error
|
||||||
# if status isn't a key, it is a multicommand
|
# if status isn't a key, it is a multicommand
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class BTMinerAPI(BaseMinerAPI):
|
|||||||
self.current_token = None
|
self.current_token = None
|
||||||
|
|
||||||
async def send_command(self,
|
async def send_command(self,
|
||||||
command: str | bytes,
|
command: str or bytes,
|
||||||
parameters: str or int or bool = None,
|
parameters: str or int or bool = None,
|
||||||
ignore_errors: bool = False
|
ignore_errors: bool = False
|
||||||
) -> dict:
|
) -> dict:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import logging
|
|||||||
|
|
||||||
|
|
||||||
class BaseMiner:
|
class BaseMiner:
|
||||||
def __init__(self, ip: str, api: BMMinerAPI | BOSMinerAPI | CGMinerAPI | BTMinerAPI | UnknownAPI) -> None:
|
def __init__(self, ip: str, api: BMMinerAPI or BOSMinerAPI or CGMinerAPI or BTMinerAPI or UnknownAPI) -> None:
|
||||||
self.ip = ipaddress.ip_address(ip)
|
self.ip = ipaddress.ip_address(ip)
|
||||||
self.uname = None
|
self.uname = None
|
||||||
self.pwd = None
|
self.pwd = None
|
||||||
|
|||||||
Reference in New Issue
Block a user