Commits

Michał Górny  committed c487024

Support getting PM version.

  • Participants
  • Parent commits a39d818

Comments (0)

Files changed (4)

File gentoopm/basepm/__init__.py

 		"""
 		pass
 
+	@abstractproperty
+	def version(self):
+		"""
+		Return the PM version as a simple string.
+
+		@type: string
+		"""
+		pass
+
 	@abstractmethod
 	def reload_config(self):
 		"""

File gentoopm/paludispm/__init__.py

 class PaludisPM(PackageManager):
 	name = 'paludis'
 
+	@property
+	def version(self):
+		return paludis.VERSION
+
 	def reload_config(self):
 		self._env = paludis.EnvironmentFactory.instance.create('')
 

File gentoopm/pkgcorepm/__init__.py

 # Released under the terms of the 2-clause BSD license.
 
 from pkgcore.config import load_config
+from pkgcore.const import VERSION
 
 from gentoopm.basepm import PackageManager
 from gentoopm.pkgcorepm.atom import PkgCoreAtom
 class PkgCorePM(PackageManager):
 	name = 'pkgcore'
 
+	@property
+	def version(self):
+		return VERSION
+
 	def reload_config(self):
 		c = load_config()
 		self._domain = c.get_default('domain')

File gentoopm/portagepm/__init__.py

 # Released under the terms of the 2-clause BSD license.
 
 import os
-from portage import create_trees
+from portage import create_trees, VERSION
 
 from gentoopm.basepm import PackageManager
 from gentoopm.portagepm.atom import PortageAtom
 class PortagePM(PackageManager):
 	name = 'portage'
 
+	@property
+	def version(self):
+		return VERSION
+
 	def reload_config(self):
 		# Similarly to emerge, care for PORTAGE_CONFIGROOT and ROOT.
 		trees = create_trees(