mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 04:52:07 +00:00
Reworks feature_flags.py to use strtobool from distutils
This commit is contained in:
@@ -1,23 +1,13 @@
|
||||
from distutils.util import strtobool
|
||||
import os
|
||||
|
||||
# env vars are strings not booleans
|
||||
# check for "false" or "0"
|
||||
# any other value is true (including empty string)
|
||||
|
||||
USE_COLOR = os.getenv("GTFF_USE_COLOR", "true").lower() not in ["false", "0"]
|
||||
USE_FLAIR = os.getenv("GTFF_USE_FLAIR", "stars")
|
||||
USE_ION = os.getenv("GTFF_USE_ION", "true").lower() not in ["false", "0"]
|
||||
USE_PROMPT_TOOLKIT = os.getenv("GTFF_USE_PROMPT_TOOLKIT", "false").lower() not in [
|
||||
"false",
|
||||
"0",
|
||||
]
|
||||
|
||||
USE_COLOR = strtobool(os.getenv("GTFF_USE_COLOR", "True"))
|
||||
USE_FLAIR = os.getenv("GTFF_USE_FLAIR") or "stars"
|
||||
USE_ION = strtobool(os.getenv("GTFF_USE_ION", "True"))
|
||||
USE_PROMPT_TOOLKIT = strtobool(os.getenv("GTFF_USE_PROMPT_TOOLKIT", "False"))
|
||||
|
||||
# Enable Prediction features
|
||||
ENABLE_PREDICT = os.getenv("GTFF_ENABLE_PREDICT", "false").lower() not in ["false", "0"]
|
||||
ENABLE_PREDICT = strtobool(os.getenv("GTFF_ENABLE_PREDICT", "False"))
|
||||
|
||||
# Enable plot autoscaling
|
||||
USE_PLOT_AUTOSCALING = os.getenv("GTFF_USE_PLOT_AUTOSCALING", "false").lower() not in [
|
||||
"false",
|
||||
"0",
|
||||
]
|
||||
USE_PLOT_AUTOSCALING = strtobool(os.getenv("GTFF_USE_PLOT_AUTOSCALING", "False"))
|
||||
|
||||
Reference in New Issue
Block a user