diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-01 18:25:27 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-01 18:25:27 +0000 |
| commit | 011572ec64f344779d06e0a149dd8e3823f79885 (patch) | |
| tree | 06dc0cb6c3ea986ebb25839c49b91b7ded2b8e3c | |
| parent | bc83f9ba294697528cee2be41ec6aac905371f1f (diff) | |
Ensure directories exist to put pot files in.
| -rw-r--r-- | i18n.py | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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): |
