summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKate Murphy <hello@kate.io>2019-04-16 20:05:45 -0400
committerKate Murphy <hello@kate.io>2019-04-17 19:40:49 -0400
commit944834593de7f6008b0edbd8d75e18face9ee2a1 (patch)
treeebb6eb1ef5c613cc5097f3986c588018fd25fabd /lib
parentd388dc60854131a7b749be278ff24045869870de (diff)
Build inx files in locale folders and build release for each locale
Diffstat (limited to 'lib')
-rw-r--r--lib/inx/utils.py13
1 files changed, 11 insertions, 2 deletions
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")