Correctly include .mo files in bundles.
This commit is contained in:
parent
d2aba901c3
commit
f00f3e2f8d
@ -41,6 +41,7 @@ class NotInstalledException(Exception): pass
|
|||||||
class InvalidPathException(Exception): pass
|
class InvalidPathException(Exception): pass
|
||||||
class ZipExtractException(Exception): pass
|
class ZipExtractException(Exception): pass
|
||||||
class RegistrationException(Exception): pass
|
class RegistrationException(Exception): pass
|
||||||
|
class MalformedBundleException(Exception): pass
|
||||||
|
|
||||||
class Bundle:
|
class Bundle:
|
||||||
"""Metadata description of a given application/activity
|
"""Metadata description of a given application/activity
|
||||||
@ -265,10 +266,12 @@ class Bundle:
|
|||||||
if not bundle_root_dir:
|
if not bundle_root_dir:
|
||||||
bundle_root_dir = file_name.split('/')[0]
|
bundle_root_dir = file_name.split('/')[0]
|
||||||
if not bundle_root_dir.endswith('.activity'):
|
if not bundle_root_dir.endswith('.activity'):
|
||||||
raise 'Incorrect bundle.'
|
raise MalformedBundleException(
|
||||||
|
'The activity directory name must end with .activity')
|
||||||
else:
|
else:
|
||||||
if not file_name.startswith(bundle_root_dir):
|
if not file_name.startswith(bundle_root_dir):
|
||||||
raise 'Incorrect bundle.'
|
raise MalformedBundleException(
|
||||||
|
'All files in the bundle must be inside the activity directory')
|
||||||
|
|
||||||
return bundle_root_dir
|
return bundle_root_dir
|
||||||
|
|
||||||
|
@ -162,8 +162,7 @@ def _get_mo_list(manifest):
|
|||||||
|
|
||||||
for lang in _get_po_list(manifest).keys():
|
for lang in _get_po_list(manifest).keys():
|
||||||
filename = _get_service_name() + '.mo'
|
filename = _get_service_name() + '.mo'
|
||||||
mo_list.append(os.path.join(_get_source_path(), 'locale',
|
mo_list.append(os.path.join('locale', lang, 'LC_MESSAGES', filename))
|
||||||
lang, 'LC_MESSAGES', filename))
|
|
||||||
|
|
||||||
return mo_list
|
return mo_list
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user