refactored location of config utility, and changed sizing of some items
This commit is contained in:
18
README.md
18
README.md
@@ -10,7 +10,7 @@ To use CFG Util you have 2 options -
|
|||||||
1. Run it directly with the file ```config_tool.py``` or import it with ```from cfg_util import main```, then run the ```main()``` function in an asyncio event loop like -
|
1. Run it directly with the file ```config_tool.py``` or import it with ```from cfg_util import main```, then run the ```main()``` function in an asyncio event loop like -
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from cfg_util import main
|
from tools.cfg_util import main
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
@@ -46,7 +46,7 @@ A basic script to find all miners on the network and get the hashrate from them
|
|||||||
```python
|
```python
|
||||||
import asyncio
|
import asyncio
|
||||||
from network import MinerNetwork
|
from network import MinerNetwork
|
||||||
from cfg_util.func.parse_data import safe_parse_api_data
|
from tools.cfg_util import safe_parse_api_data
|
||||||
|
|
||||||
|
|
||||||
async def get_hashrate():
|
async def get_hashrate():
|
||||||
@@ -82,7 +82,7 @@ You can also create your own miner without scanning if you know the IP:
|
|||||||
import asyncio
|
import asyncio
|
||||||
import ipaddress
|
import ipaddress
|
||||||
from miners.miner_factory import MinerFactory
|
from miners.miner_factory import MinerFactory
|
||||||
from cfg_util.func.parse_data import safe_parse_api_data
|
from tools.cfg_util import safe_parse_api_data
|
||||||
|
|
||||||
|
|
||||||
async def get_miner_hashrate(ip: str):
|
async def get_miner_hashrate(ip: str):
|
||||||
@@ -110,7 +110,7 @@ Or generate a miner directly without the factory:
|
|||||||
```python
|
```python
|
||||||
import asyncio
|
import asyncio
|
||||||
from miners.bosminer import BOSminer
|
from miners.bosminer import BOSminer
|
||||||
from cfg_util.func.parse_data import safe_parse_api_data
|
from tools.cfg_util import safe_parse_api_data
|
||||||
|
|
||||||
|
|
||||||
async def get_miner_hashrate(ip: str):
|
async def get_miner_hashrate(ip: str):
|
||||||
@@ -134,7 +134,7 @@ Or finally, just get the API directly:
|
|||||||
```python
|
```python
|
||||||
import asyncio
|
import asyncio
|
||||||
from API.bosminer import BOSMinerAPI
|
from API.bosminer import BOSMinerAPI
|
||||||
from cfg_util.func.parse_data import safe_parse_api_data
|
from tools.cfg_util import safe_parse_api_data
|
||||||
|
|
||||||
|
|
||||||
async def get_miner_hashrate(ip: str):
|
async def get_miner_hashrate(ip: str):
|
||||||
@@ -163,7 +163,7 @@ Now that you know that, lets move on to some common API functions that you might
|
|||||||
import asyncio
|
import asyncio
|
||||||
import ipaddress
|
import ipaddress
|
||||||
from miners.miner_factory import MinerFactory
|
from miners.miner_factory import MinerFactory
|
||||||
from cfg_util.func.parse_data import safe_parse_api_data
|
from tools.cfg_util import safe_parse_api_data
|
||||||
|
|
||||||
|
|
||||||
async def get_miner_pool_data(ip: str):
|
async def get_miner_pool_data(ip: str):
|
||||||
@@ -202,7 +202,7 @@ A pretty good example of really trying to make this robust is in ```cfg_util.fun
|
|||||||
import asyncio
|
import asyncio
|
||||||
import ipaddress
|
import ipaddress
|
||||||
from miners.miner_factory import MinerFactory
|
from miners.miner_factory import MinerFactory
|
||||||
from cfg_util.func.parse_data import safe_parse_api_data
|
from tools.cfg_util import safe_parse_api_data
|
||||||
|
|
||||||
|
|
||||||
async def get_miner_temperature_data(ip: str):
|
async def get_miner_temperature_data(ip: str):
|
||||||
@@ -232,7 +232,7 @@ How about data on the power usage of the miner? This one only works for Whatsmi
|
|||||||
import asyncio
|
import asyncio
|
||||||
import ipaddress
|
import ipaddress
|
||||||
from miners.miner_factory import MinerFactory
|
from miners.miner_factory import MinerFactory
|
||||||
from cfg_util.func.parse_data import safe_parse_api_data
|
from tools.cfg_util import safe_parse_api_data
|
||||||
|
|
||||||
|
|
||||||
async def get_miner_power_data(ip: str):
|
async def get_miner_power_data(ip: str):
|
||||||
@@ -271,7 +271,7 @@ How about we get the current pool user and hashrate in 1 command?
|
|||||||
import asyncio
|
import asyncio
|
||||||
import ipaddress
|
import ipaddress
|
||||||
from miners.miner_factory import MinerFactory
|
from miners.miner_factory import MinerFactory
|
||||||
from cfg_util.func.parse_data import safe_parse_api_data
|
from tools.cfg_util import safe_parse_api_data
|
||||||
|
|
||||||
|
|
||||||
async def get_miner_hashrate_and_pool(ip: str):
|
async def get_miner_hashrate_and_pool(ip: str):
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
from cfg_util.cfg_util_sg import main
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from cfg_util import main
|
from tools.cfg_util import main
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
1
tools/cfg_util/__init__.py
Normal file
1
tools/cfg_util/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from tools.cfg_util.cfg_util_sg import main
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
from cfg_util.cfg_util_sg.miner_factory import miner_factory
|
from tools.cfg_util.cfg_util_sg.ui import ui
|
||||||
from cfg_util.cfg_util_sg.ui import ui
|
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
@@ -6,8 +6,8 @@ import time
|
|||||||
import aiofiles
|
import aiofiles
|
||||||
import toml
|
import toml
|
||||||
|
|
||||||
from cfg_util.cfg_util_sg.func.ui import update_ui_with_data
|
from tools.cfg_util.cfg_util_sg.func.ui import update_ui_with_data
|
||||||
from cfg_util.cfg_util_sg.layout import window
|
from tools.cfg_util.cfg_util_sg.layout import window
|
||||||
from config.bos import bos_config_convert, general_config_convert_bos
|
from config.bos import bos_config_convert, general_config_convert_bos
|
||||||
|
|
||||||
|
|
||||||
@@ -4,10 +4,10 @@ import time
|
|||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from API import APIError
|
from API import APIError
|
||||||
from cfg_util.cfg_util_sg.func.parse_data import safe_parse_api_data
|
from tools.cfg_util.cfg_util_sg.func.parse_data import safe_parse_api_data
|
||||||
from cfg_util.cfg_util_sg.func.ui import update_ui_with_data, update_prog_bar, set_progress_bar_len
|
from tools.cfg_util.cfg_util_sg.func.ui import update_ui_with_data, update_prog_bar, set_progress_bar_len
|
||||||
from cfg_util.cfg_util_sg.layout import window
|
from tools.cfg_util.cfg_util_sg.layout import window
|
||||||
from cfg_util.cfg_util_sg.miner_factory import miner_factory
|
from tools.cfg_util.cfg_util_sg.miner_factory import miner_factory
|
||||||
from config.bos import bos_config_convert
|
from config.bos import bos_config_convert
|
||||||
from settings import CFG_UTIL_CONFIG_THREADS as CONFIG_THREADS, CFG_UTIL_REBOOT_THREADS as REBOOT_THREADS
|
from settings import CFG_UTIL_CONFIG_THREADS as CONFIG_THREADS, CFG_UTIL_REBOOT_THREADS as REBOOT_THREADS
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import ipaddress
|
import ipaddress
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from cfg_util.cfg_util_sg.layout import window
|
from tools.cfg_util.cfg_util_sg.layout import window
|
||||||
|
|
||||||
import pyperclip
|
import pyperclip
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -2,11 +2,11 @@ import asyncio
|
|||||||
import sys
|
import sys
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
|
||||||
from cfg_util.cfg_util_sg.layout import window, generate_config_layout
|
from tools.cfg_util.cfg_util_sg.layout import window, generate_config_layout
|
||||||
from cfg_util.cfg_util_sg.func.miners import send_config, miner_light, refresh_data, generate_config, import_config, \
|
from tools.cfg_util.cfg_util_sg.func.miners import send_config, miner_light, refresh_data, generate_config, import_config, \
|
||||||
scan_and_get_data, restart_miners_backend, reboot_miners
|
scan_and_get_data, restart_miners_backend, reboot_miners
|
||||||
from cfg_util.cfg_util_sg.func.files import import_iplist, import_config_file, export_iplist, export_config_file
|
from tools.cfg_util.cfg_util_sg.func.files import import_iplist, import_config_file, export_iplist, export_config_file
|
||||||
from cfg_util.cfg_util_sg.func.ui import sort_data, copy_from_table
|
from tools.cfg_util.cfg_util_sg.func.ui import sort_data, copy_from_table
|
||||||
|
|
||||||
from network import MinerNetwork
|
from network import MinerNetwork
|
||||||
|
|
||||||
Reference in New Issue
Block a user