From 6e19d21d3aec4bdedcfc9b3a042bb302f340c1ee Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Tue, 19 Mar 2019 16:49:19 +0100 Subject: [PATCH] chg: [tools] fix the attribution confidence level --- tools/add_missing_attribution-confidence.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/add_missing_attribution-confidence.py b/tools/add_missing_attribution-confidence.py index e80a3e8..fab5247 100755 --- a/tools/add_missing_attribution-confidence.py +++ b/tools/add_missing_attribution-confidence.py @@ -16,7 +16,11 @@ with open(args.filename) as json_file: for value in data['values']: if value.get('meta'): if not value.get('meta').get('attribution-confidence') and (value.get('meta').get('cfr-suspected-state-sponsor') or value.get('meta').get('country')): - value.get('meta')['attribution-confidence'] = 50 + value.set('meta')['attribution-confidence'] = "50" + elif value.get('meta').get('attribution-confidence') and (value.get('meta').get('cfr-suspected-state-sponsor') or value.get('meta').get('country')): + value.get('meta')['attribution-confidence'] = str(value.get('meta').get('attribution-confidence')) + + with open(args.filename, 'w') as json_file: json.dump(data, json_file, indent=2, sort_keys=True, ensure_ascii=False)