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/
74
74
PCbuild /arm64 /
75
75
PCbuild /obj /
76
76
PCbuild /win32 /
77
+ Tools /unicode /data /
77
78
.purify
78
79
__pycache__
79
80
autom4te.cache
Original file line number Diff line number Diff line change @@ -887,15 +887,18 @@ class Difference(Exception):pass
887
887
normalization_changes ))
888
888
889
889
890
+ DATA_DIR = os .path .join ('Tools' , 'unicode' , 'data' )
891
+
890
892
def open_data (template , version ):
891
- local = template % ('-' + version ,)
893
+ local = os . path . join ( DATA_DIR , template % ('-' + version ,) )
892
894
if not os .path .exists (local ):
893
895
import urllib .request
894
896
if version == '3.2.0' :
895
897
# 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 ,)
897
899
else :
898
900
url = ('http://www.unicode.org/Public/%s/ucd/' + template ) % (version , '' )
901
+ os .makedirs (DATA_DIR , exist_ok = True )
899
902
urllib .request .urlretrieve (url , filename = local )
900
903
if local .endswith ('.txt' ):
901
904
return open (local , encoding = 'utf-8' )
You can’t perform that action at this time.
0 commit comments