Added inner package name in static configuration to complete displayed application version
--- a/src/ztfy/myams/configuration.py Tue Apr 11 10:17:09 2017 +0200
+++ b/src/ztfy/myams/configuration.py Tue Apr 11 10:21:54 2017 +0200
@@ -37,7 +37,11 @@
application_package = 'ztfy.myams'
application_name = u'MyAMS'
+ inner_package = None
+ inner_package_name = None
+
version_location = u'menus'
+
include_top_links = True
include_site_search = True
include_mobile_search = True
@@ -53,7 +57,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
class MyAMSConfiguration(Persistent, Contained):
--- a/src/ztfy/myams/interfaces/configuration.py Tue Apr 11 10:17:09 2017 +0200
+++ b/src/ztfy/myams/interfaces/configuration.py Tue Apr 11 10:21:54 2017 +0200
@@ -34,6 +34,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 location"),