mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-03 10:33:08 +00:00
* allow json in env variables
This commit is contained in:
committed by
Alexander Malysh
parent
b30c1523e3
commit
c3032feaf7
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from typing import Any
|
||||
@@ -20,6 +21,11 @@ def _get_var_typed(val):
|
||||
return True
|
||||
elif val.lower() in ("f", "false"):
|
||||
return False
|
||||
# try to convert from json
|
||||
try:
|
||||
return json.loads(val)
|
||||
except json.decoder.JSONDecodeError:
|
||||
pass
|
||||
# keep as string
|
||||
return val
|
||||
|
||||
|
||||
Reference in New Issue
Block a user