add gitignore and fix a small bug with settings if the file doesn't exist
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
venv/
|
||||
build/
|
||||
__pycache__/
|
||||
pyvenv.cfg
|
||||
.env/
|
||||
bin/
|
||||
lib/
|
||||
@@ -14,16 +14,17 @@ WHATSMINER_PWD = "admin"
|
||||
|
||||
DEBUG = False
|
||||
|
||||
settings_keys = {}
|
||||
|
||||
try:
|
||||
with open(
|
||||
os.path.join(os.path.dirname(__file__), "settings.toml"), "r"
|
||||
) as settings_file:
|
||||
settings = toml.loads(settings_file.read())
|
||||
settings_keys = settings.keys()
|
||||
except:
|
||||
pass
|
||||
|
||||
settings_keys = settings.keys()
|
||||
|
||||
if "ping_retries" in settings_keys:
|
||||
NETWORK_PING_RETRIES: int = settings["ping_retries"]
|
||||
if "ping_timeout" in settings_keys:
|
||||
|
||||
Reference in New Issue
Block a user