mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] display app name everytime possible on requirements testing to improve UX
This commit is contained in:
parent
a079e3f5ee
commit
b97675516e
2 changed files with 13 additions and 13 deletions
|
@ -16,7 +16,7 @@
|
||||||
"app_change_url_success": "Successfully changed {app:s} url to {domain:s}{path:s}",
|
"app_change_url_success": "Successfully changed {app:s} url to {domain:s}{path:s}",
|
||||||
"app_extraction_failed": "Unable to extract installation files",
|
"app_extraction_failed": "Unable to extract installation files",
|
||||||
"app_id_invalid": "Invalid app id",
|
"app_id_invalid": "Invalid app id",
|
||||||
"app_incompatible": "The app is incompatible with your YunoHost version",
|
"app_incompatible": "The app {app} is incompatible with your YunoHost version",
|
||||||
"app_install_files_invalid": "Invalid installation files",
|
"app_install_files_invalid": "Invalid installation files",
|
||||||
"app_location_already_used": "An app is already installed in this location",
|
"app_location_already_used": "An app is already installed in this location",
|
||||||
"app_location_install_failed": "Unable to install the app in this location",
|
"app_location_install_failed": "Unable to install the app in this location",
|
||||||
|
@ -26,11 +26,11 @@
|
||||||
"app_not_correctly_installed": "{app:s} seems to be incorrectly installed",
|
"app_not_correctly_installed": "{app:s} seems to be incorrectly installed",
|
||||||
"app_not_installed": "{app:s} is not installed",
|
"app_not_installed": "{app:s} is not installed",
|
||||||
"app_not_properly_removed": "{app:s} has not been properly removed",
|
"app_not_properly_removed": "{app:s} has not been properly removed",
|
||||||
"app_package_need_update": "The app package needs to be updated to follow YunoHost changes",
|
"app_package_need_update": "The app {app} package needs to be updated to follow YunoHost changes",
|
||||||
"app_removed": "{app:s} has been removed",
|
"app_removed": "{app:s} has been removed",
|
||||||
"app_requirements_checking": "Checking required packages...",
|
"app_requirements_checking": "Checking required packages for {app}...",
|
||||||
"app_requirements_failed": "Unable to meet requirements: {error}",
|
"app_requirements_failed": "Unable to meet requirements for {app}: {error}",
|
||||||
"app_requirements_unmeet": "Requirements are not met, the package {pkgname} ({version}) must be {spec}",
|
"app_requirements_unmeet": "Requirements are not met for {app}, the package {pkgname} ({version}) must be {spec}",
|
||||||
"app_sources_fetch_failed": "Unable to fetch sources files",
|
"app_sources_fetch_failed": "Unable to fetch sources files",
|
||||||
"app_unknown": "Unknown app",
|
"app_unknown": "Unknown app",
|
||||||
"app_unsupported_remote_type": "Unsupported remote type used for the app",
|
"app_unsupported_remote_type": "Unsupported remote type used for the app",
|
||||||
|
|
|
@ -581,7 +581,7 @@ def app_upgrade(auth, app=[], url=None, file=None):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Check requirements
|
# Check requirements
|
||||||
_check_manifest_requirements(manifest)
|
_check_manifest_requirements(manifest, app_instance_name=app_instance_name)
|
||||||
|
|
||||||
app_setting_path = APPS_SETTING_PATH + '/' + app_instance_name
|
app_setting_path = APPS_SETTING_PATH + '/' + app_instance_name
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ def app_install(auth, app, label=None, args=None, no_remove_on_failure=False):
|
||||||
app_id = manifest['id']
|
app_id = manifest['id']
|
||||||
|
|
||||||
# Check requirements
|
# Check requirements
|
||||||
_check_manifest_requirements(manifest)
|
_check_manifest_requirements(manifest, app_id)
|
||||||
|
|
||||||
# Check if app can be forked
|
# Check if app can be forked
|
||||||
instance_number = _installed_instance_number(app_id, last=True) + 1
|
instance_number = _installed_instance_number(app_id, last=True) + 1
|
||||||
|
@ -1690,7 +1690,7 @@ def _encode_string(value):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
def _check_manifest_requirements(manifest):
|
def _check_manifest_requirements(manifest, app_instance_name):
|
||||||
"""Check if required packages are met from the manifest"""
|
"""Check if required packages are met from the manifest"""
|
||||||
requirements = manifest.get('requirements', dict())
|
requirements = manifest.get('requirements', dict())
|
||||||
|
|
||||||
|
@ -1708,12 +1708,12 @@ def _check_manifest_requirements(manifest):
|
||||||
if (not yunohost_req or
|
if (not yunohost_req or
|
||||||
not packages.SpecifierSet(yunohost_req) & '>= 2.3.6'):
|
not packages.SpecifierSet(yunohost_req) & '>= 2.3.6'):
|
||||||
raise MoulinetteError(errno.EINVAL, '{0}{1}'.format(
|
raise MoulinetteError(errno.EINVAL, '{0}{1}'.format(
|
||||||
m18n.g('colon', m18n.n('app_incompatible')),
|
m18n.g('colon', m18n.n('app_incompatible'), app=app_instance_name),
|
||||||
m18n.n('app_package_need_update')))
|
m18n.n('app_package_need_update', app=app_instance_name)))
|
||||||
elif not requirements:
|
elif not requirements:
|
||||||
return
|
return
|
||||||
|
|
||||||
logger.info(m18n.n('app_requirements_checking'))
|
logger.info(m18n.n('app_requirements_checking', app=app_instance_name))
|
||||||
|
|
||||||
# Retrieve versions of each required package
|
# Retrieve versions of each required package
|
||||||
try:
|
try:
|
||||||
|
@ -1722,7 +1722,7 @@ def _check_manifest_requirements(manifest):
|
||||||
except packages.PackageException as e:
|
except packages.PackageException as e:
|
||||||
raise MoulinetteError(errno.EINVAL,
|
raise MoulinetteError(errno.EINVAL,
|
||||||
m18n.n('app_requirements_failed',
|
m18n.n('app_requirements_failed',
|
||||||
error=str(e)))
|
error=str(e), app=app_instance_name))
|
||||||
|
|
||||||
# Iterate over requirements
|
# Iterate over requirements
|
||||||
for pkgname, spec in requirements.items():
|
for pkgname, spec in requirements.items():
|
||||||
|
@ -1731,7 +1731,7 @@ def _check_manifest_requirements(manifest):
|
||||||
raise MoulinetteError(
|
raise MoulinetteError(
|
||||||
errno.EINVAL, m18n.n('app_requirements_unmeet',
|
errno.EINVAL, m18n.n('app_requirements_unmeet',
|
||||||
pkgname=pkgname, version=version,
|
pkgname=pkgname, version=version,
|
||||||
spec=spec))
|
spec=spec, app=app_instance_name))
|
||||||
|
|
||||||
|
|
||||||
def _parse_args_from_manifest(manifest, action, args={}, auth=None):
|
def _parse_args_from_manifest(manifest, action, args={}, auth=None):
|
||||||
|
|
Loading…
Add table
Reference in a new issue