Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/python | |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """A simple script for downloading latest dictionaries.""" | |
| 7 | |
| 8 import os | |
| 9 import sys | |
| 10 import urllib | |
| 11 from zipfile import ZipFile | |
| 12 | |
| 13 | |
| 14 def main(): | |
| 15 if not os.getcwd().endswith("hunspell_dictionaries"): | |
| 16 print "Please run this file from the hunspell_dictionaries directory" | |
| 17 return 1 | |
| 18 dictionaries = ( | |
| 19 ("http://downloads.sourceforge.net/wordlist/" | |
| 20 "hunspell-en_US-2015.08.24.zip", | |
|
please use gerrit instead
2016/03/18 17:46:20
btw, the latest versions are 2016.01.19.
| |
| 21 "en_US.zip"), | |
| 22 ("http://downloads.sourceforge.net/wordlist/" | |
| 23 "hunspell-en_CA-2015.08.24.zip", | |
| 24 "en_CA.zip"), | |
| 25 ("http://downloads.sourceforge.net/lilak/" | |
| 26 "lilak_fa-IR_2-0.zip", | |
| 27 "fa_IR.zip") | |
| 28 ) | |
| 29 for pair in dictionaries: | |
| 30 urllib.urlretrieve(pair[0], pair[1]) | |
| 31 ZipFile(pair[1]).extractall() | |
| 32 os.remove(pair[1]) | |
| 33 return 0 | |
| 34 | |
| 35 if __name__ == "__main__": | |
| 36 sys.exit(main()) | |
| OLD | NEW |