File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ PCbuild/arm32/
7474PCbuild /arm64 /
7575PCbuild /obj /
7676PCbuild /win32 /
77+ Tools /unicode /data /
7778.purify
7879__pycache__
7980autom4te.cache
Original file line number Diff line number Diff line change @@ -887,15 +887,18 @@ class Difference(Exception):pass
887887 normalization_changes ))
888888
889889
890+ DATA_DIR = os .path .join ('Tools' , 'unicode' , 'data' )
891+
890892def open_data (template , version ):
891- local = template % ('-' + version ,)
893+ local = os . path . join ( DATA_DIR , template % ('-' + version ,) )
892894 if not os .path .exists (local ):
893895 import urllib .request
894896 if version == '3.2.0' :
895897 # irregular url structure
896- url = 'http://www.unicode.org/Public/3.2-Update/' + local
898+ url = ( 'http://www.unicode.org/Public/3.2-Update/' + template ) % ( '-' + version ,)
897899 else :
898900 url = ('http://www.unicode.org/Public/%s/ucd/' + template ) % (version , '' )
901+ os .makedirs (DATA_DIR , exist_ok = True )
899902 urllib .request .urlretrieve (url , filename = local )
900903 if local .endswith ('.txt' ):
901904 return open (local , encoding = 'utf-8' )
You can’t perform that action at this time.
0 commit comments