From 944834593de7f6008b0edbd8d75e18face9ee2a1 Mon Sep 17 00:00:00 2001 From: Kate Murphy Date: Tue, 16 Apr 2019 20:05:45 -0400 Subject: Build inx files in locale folders and build release for each locale --- lib/inx/utils.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/inx/utils.py') diff --git a/lib/inx/utils.py b/lib/inx/utils.py index a22b1892..1dc96829 100644 --- a/lib/inx/utils.py +++ b/lib/inx/utils.py @@ -1,3 +1,4 @@ +import errno import os import gettext from os.path import dirname @@ -28,8 +29,16 @@ def build_environment(): def write_inx_file(name, contents): - inx_file_name = "inkstitch_%s_%s.inx" % (name, current_locale) - with open(os.path.join(inx_path, inx_file_name), 'w') as inx_file: + inx_locale_dir = os.path.join(inx_path, current_locale) + + try: + os.makedirs(inx_locale_dir) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + inx_file_name = "inkstitch_%s.inx" % name + with open(os.path.join(inx_locale_dir, inx_file_name), 'w') as inx_file: print >> inx_file, contents.encode("utf-8") -- cgit v1.2.3