Skip to content

Commit

Permalink
FIR config parse (#109)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko259 <animationsisnice@gmail.com>
  • Loading branch information
thor and Marko259 authored Jan 26, 2025
1 parent 5901a6a commit 2c9b269
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions helpers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,18 @@ def __init__(self):
self.RATING_FIR_DATA_RAW = os.getenv('RATING_FIR_DATA', '')
self.RATING_FIR_DATA = {}
if self.RATING_FIR_DATA_RAW:
fir_entries = self.RATING_FIR_DATA_RAW.split('|')
fir_name = fir_entries[0].strip()
ratings = {}
fir_entries = self.RATING_FIR_DATA_RAW.split(',')

for rating_entry in fir_entries[1:]:
rating, role_id = rating_entry.split(':')
ratings[rating.strip()] = int(role_id.strip())
for fir_entry in fir_entries:
parts = fir_entry.split('|')
fir_name = parts[0].strip()
ratings = {}

self.RATING_FIR_DATA[fir_name] = ratings
for rating_entry in fir_entries[1:]:
rating, role_id = rating_entry.split(':')
ratings[rating.strip()] = int(role_id.strip())

self.RATING_FIR_DATA[fir_name] = ratings

self.c1_equivalent_ratings = {"ADM", "SUP", "C1", "C2", "C3", "I1", "I3"}

Expand Down

0 comments on commit 2c9b269

Please sign in to comment.