summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-01 18:25:27 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-01 18:25:27 +0000
commit011572ec64f344779d06e0a149dd8e3823f79885 (patch)
tree06dc0cb6c3ea986ebb25839c49b91b7ded2b8e3c
parentbc83f9ba294697528cee2be41ec6aac905371f1f (diff)
Ensure directories exist to put pot files in.
-rw-r--r--i18n.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/i18n.py b/i18n.py
index ab7f6843b..8e2fd6404 100644
--- a/i18n.py
+++ b/i18n.py
@@ -2,19 +2,21 @@ import glob
import os
from waflib import Logs
-def pot(dir, sources, name, all = False):
+def pot(dir, sources, name):
s = ""
for f in sources.split('\n'):
t = f.strip()
if len(t) > 0:
s += (os.path.join(dir, t)) + " "
- if all:
- Logs.info('Making %s.pot (extracting all)' % os.path.join('build', dir, name))
- os.system('xgettext -d %s -s --extract-all -p %s -o %s.pot %s' % (name, os.path.join('build', dir), name, s))
- else:
- Logs.info('Making %s.pot' % os.path.join('build', dir, name))
- os.system('xgettext -d %s -s --keyword=_ --add-comments=/ -p %s -o %s.pot %s' % (name, os.path.join('build', dir), name, s))
+ Logs.info('Making %s.pot' % os.path.join('build', dir, name))
+ d = os.path.join('build', dir)
+ try:
+ os.makedirs(d)
+ except:
+ pass
+
+ os.system('xgettext -d %s -s --keyword=_ --add-comments=/ -p %s -o %s.pot %s' % (name, d, name, s))
def po_to_mo(dir, name, bld):