midori/po/wscript_build
2008-10-30 02:21:19 +01:00

34 lines
1.1 KiB
Python

#! /usr/bin/env python
# WAF build script for midori
# This file is licensed under the terms of the expat license, see the file EXPAT.
import Params
import pproc as subprocess
import os
APPNAME = 'midori'
if bld.env ()['INTLTOOL_UPDATE']:
os.chdir ('./po')
try:
try:
size_old = os.stat (APPNAME + '.pot').st_size
except:
size_old = 0
subprocess.call (['intltool-update', '--pot'])
size_new = os.stat (APPNAME + '.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 ('..')
obj = bld.create_obj ('intltool_po')
obj.appname = APPNAME