From 8e964de8c4541ef3efa1ae78441fe59d8205f1c1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 Jul 2008 21:51:17 -0700 Subject: [PATCH] IGN:Look for Qt translations in the right place on Mandriva --- resources.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/resources.py b/resources.py index a969329a16..f1bea6fd08 100644 --- a/resources.py +++ b/resources.py @@ -22,17 +22,19 @@ def main(args=sys.argv): bytes = repr(open(path, 'rb').read()) data += key + ' = ' + bytes + '\n\n' - TPATH = '/usr/share/qt4/translations' - if os.path.exists(TPATH): - files = glob.glob(TPATH + '/qt_??.qm') - - for f in files: - key = os.path.basename(f).partition('.')[0] - bytes = repr(open(f, 'rb').read()) - data += key + ' = ' + bytes + '\n\n' - - else: - print 'WARNING: Could not find Qt transations in', TPATH + translations_found = False + for TPATH in ('/usr/share/qt4/translations', '/usr/lib/qt4/translations'): + if os.path.exists(TPATH): + files = glob.glob(TPATH + '/qt_??.qm') + + for f in files: + key = os.path.basename(f).partition('.')[0] + bytes = repr(open(f, 'rb').read()) + data += key + ' = ' + bytes + '\n\n' + translations_found = True + break + if not translations_found: + print 'WARNING: Could not find Qt transations' open('src'+os.sep+__appname__+os.sep+'/resources.py', 'wb').write(data) return 0