# HG changeset patch # User Thierry Florac # Date 1492509590 -7200 # Node ID 2a582df9842b9a1fdb64259460b06ef614ab7f8c # Parent 4ab1f514b9f01d7d44ac3a20bfbb75d1afdae59c Updated configuration interface to display inner package name and version diff -r 4ab1f514b9f0 -r 2a582df9842b src/pyams_skin/configuration.py --- a/src/pyams_skin/configuration.py Tue Apr 18 11:40:10 2017 +0200 +++ b/src/pyams_skin/configuration.py Tue Apr 18 11:59:50 2017 +0200 @@ -54,6 +54,8 @@ application_package = 'pyams_skin' application_name = 'PyAMS' + inner_package = None + inner_package_name = None version_location = 'menus' @@ -77,7 +79,11 @@ @property def version(self): - return pkg_resources.get_distribution(self.application_package).version + result = pkg_resources.get_distribution(self.application_package).version + if self.inner_package: + result += ' (%s v%s)' % (self.inner_package_name, + pkg_resources.get_distribution(self.inner_package).version) + return result @adapter_config(name='static_configuration', context=(Interface, Interface, Interface), provides=ITALESExtension) diff -r 4ab1f514b9f0 -r 2a582df9842b src/pyams_skin/interfaces/configuration.py --- a/src/pyams_skin/interfaces/configuration.py Tue Apr 18 11:40:10 2017 +0200 +++ b/src/pyams_skin/interfaces/configuration.py Tue Apr 18 11:59:50 2017 +0200 @@ -40,6 +40,14 @@ description="This name is used to display application version", required=False) + inner_package = TextLine(title=_("Inner package"), + description=_("This is another important package displayed in application version"), + required=False) + + inner_package_name = TextLine(title=_("Inner package name"), + description=_("Package name used to display application version"), + required=False) + version = Attribute("Application version") version_location = Choice(title="Version label location",