From 0a3b91a49462a2d8dd74f92928ce53afb7d88fda Mon Sep 17 00:00:00 2001 From: clothespin Date: Tue, 16 Mar 2021 21:23:18 -0700 Subject: [PATCH] Tests string-valued env variables for truthiness in feature_flags.py --- .github/workflows/Mac.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- .github/workflows/windows.yml | 4 ++-- gamestonk_terminal/feature_flags.py | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Mac.yml b/.github/workflows/Mac.yml index 6e53446908f..996a29b56f8 100644 --- a/.github/workflows/Mac.yml +++ b/.github/workflows/Mac.yml @@ -1,7 +1,7 @@ name: Mac OS X Full Clean Build with ML env: - GTFF_USE_PROMPT_TOOLKIT: - GTFF_USE_ION: + GTFF_USE_PROMPT_TOOLKIT: false + GTFF_USE_ION: false on: push: branches: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc6b8d48358..014bd992e6b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: Tests env: - GTFF_USE_PROMPT_TOOLKIT: - GTFF_USE_ION: + GTFF_USE_PROMPT_TOOLKIT: false + GTFF_USE_ION: false on: [pull_request, push] jobs: linting: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4a5608f55f6..3e469e6fddf 100755 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,7 +1,7 @@ name: Windows 10 Full Clean Build with ML env: - GTFF_USE_PROMPT_TOOLKIT: - GTFF_USE_ION: + GTFF_USE_PROMPT_TOOLKIT: false + GTFF_USE_ION: false on: push: branches: diff --git a/gamestonk_terminal/feature_flags.py b/gamestonk_terminal/feature_flags.py index cb7481d9127..45b7071bba2 100755 --- a/gamestonk_terminal/feature_flags.py +++ b/gamestonk_terminal/feature_flags.py @@ -1,12 +1,12 @@ import os -USE_COLOR = os.getenv("GTFF_USE_COLOR") or True +USE_COLOR = os.getenv("GTFF_USE_COLOR").lower() not in ['false', '0'] or True USE_FLAIR = os.getenv("GTFF_USE_FLAIR") or "stars" -USE_ION = os.getenv("GTFF_USE_ION") or True -USE_PROMPT_TOOLKIT = os.getenv("GTFF_USE_PROMPT_TOOLKIT") or False +USE_ION = os.getenv("GTFF_USE_ION").lower() not in ['false', '0'] or True +USE_PROMPT_TOOLKIT = os.getenv("GTFF_USE_PROMPT_TOOLKIT").lower() not in ['false', '0'] or False # Enable Prediction features -ENABLE_PREDICT = os.getenv("GTFF_ENABLE_PREDICT") or False +ENABLE_PREDICT = os.getenv("GTFF_ENABLE_PREDICT").lower() not in ['false', '0'] or False # Enable plot autoscaling -USE_PLOT_AUTOSCALING = os.getenv("GTFF_USE_PLOT_AUTOSCALING") or False +USE_PLOT_AUTOSCALING = os.getenv("GTFF_USE_PLOT_AUTOSCALING").lower() not in ['false', '0'] or False