Blame SOURCES/trademarks.py

33a46c
#! /usr/bin/python3
33a46c
33a46c
# Small and dirty script to create the README-Trademarks.txt file. This file
33a46c
# has to be created by scratch at every release. To do so, use:
33a46c
# ./trademarks.py > README-Trademarks.txt
33a46c
33a46c
from urllib.request import urlopen
33a46c
import json
33a46c
33a46c
response = urlopen('https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/metadata/icons.json')
33a46c
if response.code != 200:
33a46c
    print("Got HTTP ", response.code);
33a46c
    exit(1)
33a46c
document = json.loads(response.fp.read())
33a46c
33a46c
brands = []
33a46c
33a46c
for icon in document:
33a46c
    if 'brands' in document[icon]['styles']:
33a46c
        brands.append(icon)
33a46c
33a46c
brands.sort()
33a46c
33a46c
out = 'Brand icons may be subject to trademark and brand guidelines of their\n'
33a46c
out+= 'respective owners. Always check before deploying other companies\' branding.\n'
33a46c
out+= '\n'
33a46c
out+= 'Brand Icons:'
33a46c
33a46c
for brand in brands:
33a46c
    out+= '\n * fa-' + brand
33a46c
33a46c
print(out)