refactored files and folders
This commit is contained in:
21
settings/__init__.py
Normal file
21
settings/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import toml
|
||||
import os
|
||||
|
||||
try:
|
||||
with open(os.path.join(os.getcwd(), "settings.toml"), "r") as settings_file:
|
||||
settings = toml.loads(settings_file.read())
|
||||
NETWORK_PING_RETRIES: int = settings["ping_retries"]
|
||||
NETWORK_PING_TIMEOUT: int = settings["ping_timeout"]
|
||||
NETWORK_SCAN_THREADS: int = settings["scan_threads"]
|
||||
|
||||
CFG_UTIL_CONFIG_THREADS: int = settings["config_threads"]
|
||||
|
||||
MINER_FACTORY_GET_VERSION_RETRIES: int = settings["get_version_retries"]
|
||||
except:
|
||||
NETWORK_PING_RETRIES: int = 3
|
||||
NETWORK_PING_TIMEOUT: int = 5
|
||||
NETWORK_SCAN_THREADS: int = 300
|
||||
|
||||
CFG_UTIL_CONFIG_THREADS: int = 300
|
||||
|
||||
MINER_FACTORY_GET_VERSION_RETRIES: int = 3
|
||||
5
settings/settings.toml
Normal file
5
settings/settings.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
get_version_retries = 3
|
||||
ping_retries = 3
|
||||
ping_timeout = 5
|
||||
scan_threads = 300
|
||||
config_threads = 300
|
||||
Reference in New Issue
Block a user