[fix] ensure CLDR dir
This commit is contained in:
@@ -5,6 +5,7 @@ import sys
|
|||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from unicode_paths import CLDR_DIR
|
from unicode_paths import CLDR_DIR
|
||||||
|
from geodata.file_utils import ensure_dir
|
||||||
|
|
||||||
this_dir = os.path.realpath(os.path.dirname(__file__))
|
this_dir = os.path.realpath(os.path.dirname(__file__))
|
||||||
sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir)))
|
sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir)))
|
||||||
@@ -15,7 +16,7 @@ CLDR_URL = 'http://www.unicode.org/Public/cldr/latest/core.zip'
|
|||||||
def download_cldr(temp_dir=None):
|
def download_cldr(temp_dir=None):
|
||||||
if os.path.exists(CLDR_DIR):
|
if os.path.exists(CLDR_DIR):
|
||||||
shutil.rmtree(CLDR_DIR)
|
shutil.rmtree(CLDR_DIR)
|
||||||
os.mkdir(CLDR_DIR)
|
ensure_dir(CLDR_DIR)
|
||||||
|
|
||||||
if not temp_dir:
|
if not temp_dir:
|
||||||
temp_dir = tempfile.gettempdir()
|
temp_dir = tempfile.gettempdir()
|
||||||
|
|||||||
Reference in New Issue
Block a user