Skip to content

Commit

Permalink
fix: allow no debug var, add corpus colors
Browse files Browse the repository at this point in the history
  • Loading branch information
engisalor committed Oct 24, 2023
1 parent 3b32d95 commit 5f1c461
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self):
self.MAX_QUERIES = os.getenv("MAX_QUERIES")
self.MAX_ITEMS = os.getenv("MAX_ITEMS")
self.SERVER_URL = os.getenv("SERVER_URL")
self.DASH_DEBUG = os.getenv("DASH_DEBUG").lower()
self.DASH_DEBUG = os.getenv("DASH_DEBUG")
for k, v in self.__dict__.items():
if not v:
if k == "GUIDE_MD":
Expand All @@ -43,7 +43,10 @@ def __init__(self):
if k in ["MAX_QUERIES", "MAX_ITEMS"]:
setattr(self, k, int(v))
if k in ["DASH_DEBUG"]:
setattr(self, k, v.lower() == "true")
if not v:
setattr(self, k, False)
else:
setattr(self, k, v.lower() == "true")
self.sgex = {
"api_key": os.getenv("SGEX_API_KEY"),
"server": os.getenv("SGEX_SERVER"),
Expand Down Expand Up @@ -74,6 +77,7 @@ class CorpData:
def __init__(self):
# load corpora file
self.dt = read_yaml(env.CORPORA_YML)
self.colors = {v["name"]: v["color"] for k, v in self.dt.items()}
corp_ids = list(self.dt.keys())
# make corpinfo calls
corpinfo_calls = [
Expand Down

0 comments on commit 5f1c461

Please sign in to comment.