fixed some small bugs with whatsminers and progress bar
This commit is contained in:
@@ -193,6 +193,8 @@ If you are sure you want to use this command please use API.send_command("{item}
|
|||||||
str_data = str_data.replace("}{", "},{")
|
str_data = str_data.replace("}{", "},{")
|
||||||
# fix an error with a bmminer return having a specific comma that breaks json.loads()
|
# fix an error with a bmminer return having a specific comma that breaks json.loads()
|
||||||
str_data = str_data.replace("[,{", "[{")
|
str_data = str_data.replace("[,{", "[{")
|
||||||
|
# fix an error with a btminer return having a specific comma that breaks json.loads()
|
||||||
|
str_data = str_data.replace("inf", "0")
|
||||||
# parse the json
|
# parse the json
|
||||||
parsed_data = json.loads(str_data)
|
parsed_data = json.loads(str_data)
|
||||||
# handle bad json
|
# handle bad json
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ async def btn_config(table, selected, config: str, last_oct_ip: bool):
|
|||||||
async def send_config(ips: list, config: str, last_octet_ip: bool):
|
async def send_config(ips: list, config: str, last_octet_ip: bool):
|
||||||
global progress_bar_len
|
global progress_bar_len
|
||||||
progress_bar_len = 0
|
progress_bar_len = 0
|
||||||
await update_prog_bar(progress_bar_len, max=(2 * len(ips)))
|
await update_prog_bar(progress_bar_len, _max=(2 * len(ips)))
|
||||||
get_miner_genenerator = MinerFactory().get_miner_generator(ips)
|
get_miner_genenerator = MinerFactory().get_miner_generator(ips)
|
||||||
all_miners = []
|
all_miners = []
|
||||||
async for miner in get_miner_genenerator:
|
async for miner in get_miner_genenerator:
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ async def update_miners_data(miners: list):
|
|||||||
|
|
||||||
global progress_bar_len
|
global progress_bar_len
|
||||||
progress_bar_len = 0
|
progress_bar_len = 0
|
||||||
await update_prog_bar(progress_bar_len, max=len(miners))
|
await update_prog_bar(progress_bar_len, _max=len(miners))
|
||||||
data_generator = asyncio.as_completed(
|
data_generator = asyncio.as_completed(
|
||||||
[_get_data(await MinerFactory().get_miner(miner)) for miner in miners]
|
[_get_data(await MinerFactory().get_miner(miner)) for miner in miners]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -137,11 +137,11 @@ class TableManager(metaclass=Singleton):
|
|||||||
item[
|
item[
|
||||||
"Hashrate"
|
"Hashrate"
|
||||||
] = f"{format(float(item['Hashrate']), '.2f').rjust(6, ' ')} TH/s"
|
] = f"{format(float(item['Hashrate']), '.2f').rjust(6, ' ')} TH/s"
|
||||||
for key in keys:
|
for _key in keys:
|
||||||
for table in TABLE_HEADERS.keys():
|
for table in TABLE_HEADERS.keys():
|
||||||
for idx, header in enumerate(TABLE_HEADERS[table]):
|
for idx, header in enumerate(TABLE_HEADERS[table]):
|
||||||
if key == header:
|
if _key == header:
|
||||||
tables[table][data_idx][idx] = item[key]
|
tables[table][data_idx][idx] = item[_key]
|
||||||
|
|
||||||
window["scan_table"].update(tables["SCAN"])
|
window["scan_table"].update(tables["SCAN"])
|
||||||
window["pools_table"].update(tables["POOLS_ALL"])
|
window["pools_table"].update(tables["POOLS_ALL"])
|
||||||
|
|||||||
Reference in New Issue
Block a user