xref: /aosp_15_r20/external/brotli/scripts/dictionary/step-01-download-rfc.py (revision f4ee7fba7774faf2a30f13154332c0a06550dbc4)
1# Step 01 - download RFC7932.
2#
3# RFC is the ultimate source for brotli format and constants, including
4# static dictionary.
5
6import urllib2
7
8response = urllib2.urlopen('https://tools.ietf.org/rfc/rfc7932.txt')
9
10text = response.read()
11path = "rfc7932.txt"
12
13with open(path, "w") as rfc:
14  rfc.write(text)
15
16print("Downloaded and saved " + str(len(text)) + " bytes to " + path)
17