midori/po/wscript_build

33 lines
1.1 KiB
Text
Raw Normal View History

2008-05-31 09:55:54 +00:00
#! /usr/bin/env python
# WAF build script for midori
# This file is licensed under the terms of the expat license, see the file EXPAT.
2008-05-31 09:55:54 +00:00
import Params
import pproc as subprocess
import os
if bld.env ()['INTLTOOL_UPDATE']:
os.chdir ('./po')
try:
try:
size_old = os.stat ('midori.pot').st_size
except:
size_old = 0
subprocess.call (['intltool-update', '--pot'])
size_new = os.stat ('midori.pot').st_size
if size_new <> size_old:
Params.pprint ('YELLOW', "Updated po template.")
try:
intltool_update = subprocess.Popen (['intltool-update', '-r'],
stderr=subprocess.PIPE)
intltool_update.wait ()
Params.pprint ('YELLOW', "Updated translations.")
except:
Params.pprint ('RED', "Failed to update translations.")
except:
Params.pprint ('RED', "Failed to generate po template.")
os.chdir ('..')
2008-05-31 09:55:54 +00:00
obj = bld.create_obj ('intltool_po')
obj.appname = 'midori'