31 lines
1,006 B
Python
31 lines
1,006 B
Python
#! /usr/bin/env python
|
|
# WAF build script for midori
|
|
|
|
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 ('..')
|
|
|
|
obj = bld.create_obj ('intltool_po')
|
|
obj.appname = 'midori'
|