Edit

kc3-lang/brotli/scripts/dictionary/step-01-download-rfc.py

Branch :

  • Show log

    Commit

  • Author : Eugene Kliuchnikov
    Date : 2021-08-31 14:07:17
    Hash : 0e42caf3
    Message : Migrate to github actions (#920) Not all combinations are migrated to the initial configuration; corresponding TODOs added. Drive-by: additional combinations uncovered minor portability problems -> fixed Drive-by: remove no-longer used "script" files. Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>

  • scripts/dictionary/step-01-download-rfc.py
  • # Step 01 - download RFC7932.
    #
    # RFC is the ultimate source for brotli format and constants, including
    # static dictionary.
    
    import urllib2
    
    response = urllib2.urlopen("https://tools.ietf.org/rfc/rfc7932.txt")
    
    text = response.read()
    path = "rfc7932.txt"
    
    with open(path, "w") as rfc:
      rfc.write(text)
    
    print("Downloaded and saved " + str(len(text)) + " bytes to " + path)