IGN:Look for Qt translations in the right place on Mandriva

This commit is contained in:
Kovid Goyal 2008-07-31 21:51:17 -07:00
parent 917cbdf348
commit 8e964de8c4

View File

@ -22,17 +22,19 @@ def main(args=sys.argv):
bytes = repr(open(path, 'rb').read()) bytes = repr(open(path, 'rb').read())
data += key + ' = ' + bytes + '\n\n' data += key + ' = ' + bytes + '\n\n'
TPATH = '/usr/share/qt4/translations' translations_found = False
if os.path.exists(TPATH): for TPATH in ('/usr/share/qt4/translations', '/usr/lib/qt4/translations'):
files = glob.glob(TPATH + '/qt_??.qm') if os.path.exists(TPATH):
files = glob.glob(TPATH + '/qt_??.qm')
for f in files:
key = os.path.basename(f).partition('.')[0] for f in files:
bytes = repr(open(f, 'rb').read()) key = os.path.basename(f).partition('.')[0]
data += key + ' = ' + bytes + '\n\n' bytes = repr(open(f, 'rb').read())
data += key + ' = ' + bytes + '\n\n'
else: translations_found = True
print 'WARNING: Could not find Qt transations in', TPATH break
if not translations_found:
print 'WARNING: Could not find Qt transations'
open('src'+os.sep+__appname__+os.sep+'/resources.py', 'wb').write(data) open('src'+os.sep+__appname__+os.sep+'/resources.py', 'wb').write(data)
return 0 return 0