Fix OS X language selection and update .version in OS X build

bzr-revno: 1432
This commit is contained in:
Matthias Hub 2011-03-27 22:36:00 +01:00 committed by Jonathan Corwin
commit ea16d11011
5 changed files with 38 additions and 7 deletions

View File

@ -91,7 +91,7 @@ class LanguageManager(object):
""" """
Retrieve a saved language to use from settings Retrieve a saved language to use from settings
""" """
settings = QtCore.QSettings(u'OpenLP', u'OpenLP') settings = QtCore.QSettings()
language = unicode(settings.value( language = unicode(settings.value(
u'general/language', QtCore.QVariant(u'[en]')).toString()) u'general/language', QtCore.QVariant(u'[en]')).toString())
log.info(u'Language file: \'%s\' Loaded from conf file' % language) log.info(u'Language file: \'%s\' Loaded from conf file' % language)

View File

@ -394,10 +394,7 @@ if __name__ == '__main__':
--template Info.plist.master \ --template Info.plist.master \
--expandto %(target_directory)s/Info.plist' \ --expandto %(target_directory)s/Info.plist' \
% { 'config_file' : options.config, 'target_directory' : os.getcwd() }) % { 'config_file' : options.config, 'target_directory' : os.getcwd() })
os.system('python expander.py --config %(config_file)s \ os.system('python get_version.py > .version')
--template version.master \
--expandto %(target_directory)s/.version' \
% { 'config_file' : options.config, 'target_directory' : os.getcwd() })
# prepare variables # prepare variables
app_name_lower = settings['openlp_appname'].lower() app_name_lower = settings['openlp_appname'].lower()

View File

@ -0,0 +1,36 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
from bzrlib.branch import Branch
def get_version(path):
b = Branch.open_containing(path)[0]
b.lock_read()
result = '0.0.0'
try:
# Get the branch's latest revision number.
revno = b.revno()
# Convert said revision number into a bzr revision id.
revision_id = b.dotted_revno_to_revision_id((revno,))
# Get a dict of tags, with the revision id as the key.
tags = b.tags.get_reverse_tag_dict()
# Check if the latest
if revision_id in tags:
result = tags[revision_id][0]
else:
result = '%s-bzr%s' % (sorted(b.tags.get_tag_dict().keys())[-1], revno)
finally:
b.unlock()
return result
def get_path():
if len(sys.argv) > 1:
return os.path.abspath(sys.argv[1])
else:
return os.path.abspath('.')
if __name__ == u'__main__':
path = get_path()
print get_version(path)

View File

@ -2,7 +2,6 @@
openlp_appname = OpenLP openlp_appname = OpenLP
openlp_dmgname = OpenLP-1.9.4-bzrXXXX openlp_dmgname = OpenLP-1.9.4-bzrXXXX
openlp_version = XXXX openlp_version = XXXX
openlp_full_version = 1.9.4-latest
openlp_basedir = /Users/openlp/trunk openlp_basedir = /Users/openlp/trunk
openlp_icon_file = openlp-logo-with-text.icns openlp_icon_file = openlp-logo-with-text.icns
openlp_dmg_icon_file = openlp-logo-420x420.png openlp_dmg_icon_file = openlp-logo-420x420.png

View File

@ -1 +0,0 @@
%(openlp_full_version)s