[fix] ensure CLDR dir

This commit is contained in:
Al
2015-08-11 20:04:42 -04:00
parent 48566bf097
commit 882e4c2ab8

View File

@@ -5,6 +5,7 @@ import sys
import tempfile
from unicode_paths import CLDR_DIR
from geodata.file_utils import ensure_dir
this_dir = os.path.realpath(os.path.dirname(__file__))
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):
if os.path.exists(CLDR_DIR):
shutil.rmtree(CLDR_DIR)
os.mkdir(CLDR_DIR)
ensure_dir(CLDR_DIR)
if not temp_dir:
temp_dir = tempfile.gettempdir()