

import json, sys, os

if len(sys.argv) > 1:
    first_argument = sys.argv[1]
    print("The first command-line argument is:", first_argument)
else:
    print("No command-line arguments provided.")
    exit()

def load(name):
    file = open(sys.argv[1], 'r', encoding='utf-8').read()
    dbdump = json.loads(file)
    return dbdump

def save(val,name):
    pretty = json.dumps(val, indent=2).encode().decode('unicode-escape')
    open(name, 'w', encoding='utf-8').write(pretty)


dd = load(sys.argv[1])



dis = {
    "$type": "System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[System.Boolean, mscorlib]], mscorlib",
}

for e in dd:

    dis[e['EvaluationMessageTypeCategoryId']] = e['IsEnabled'] == "0"

# save(cat, os.path.dirname(os.path.realpath(sys.argv[1])) + '/EvaluationMessageTypeCategories.json')
save(dis, os.path.dirname(os.path.realpath(sys.argv[1])) + '/EvaluationMessageTypeCategoriesDisabled.json')



print('done')