mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-21 10:17:05 +02:00
Config file support for histogram buckets
This commit is contained in:
1 parent
d94318a744
commit
c36f49555a
1 file changed
+21
@@ -550,6 +550,16 @@ async def main(argv):
|
||||
except (KeyError, configparser.NoSectionError) as err:
|
||||
bu.error(exception=err)
|
||||
|
||||
try:
|
||||
if 'ANALYZER' in config.sections():
|
||||
configAnalyzer = config['ANALYZER']
|
||||
histogram_fields_str = configAnalyzer.get('histogram_buckets', None)
|
||||
if histogram_fields_str != None:
|
||||
set_histogram_buckets(json.loads(histogram_fields_str))
|
||||
|
||||
except (KeyError, configparser.NoSectionError) as err:
|
||||
bu.error(exception=err)
|
||||
|
||||
try:
|
||||
if 'WG' in config.sections():
|
||||
configWG = config['WG']
|
||||
@@ -690,6 +700,17 @@ async def main(argv):
|
||||
if wi != None: await wi.close()
|
||||
return None
|
||||
|
||||
|
||||
def set_histogram_buckets(json: dict):
|
||||
global histogram_fields
|
||||
try:
|
||||
for field in json.keys():
|
||||
histogram_fields[field][1] = json[field]
|
||||
except (KeyError, Exception) as err:
|
||||
bu.error(exception=err)
|
||||
return histogram_fields
|
||||
|
||||
|
||||
def process_player_dist(results: list, player_stats: dict, stat_id_map: dict):
|
||||
"""Process player distribution"""
|
||||
hist_stats = dict()
|
||||
|
||||
Reference in new issue
Block a user