1. Michał Górny
  2. gentoopm

Commits

Michał Górny  committed bbbab2c

Support getting package homepages.

  • Participants
  • Parent commits 6648a9c
  • Branches master

Comments (0)

Files changed (4)

File gentoopm/basepm/pkg.py

View file
 		"""
 		pass
 
+	@abstractproperty
+	def homepages(self):
+		"""
+		Homepages of a package.
+
+		@type: L{SpaceSepTuple}
+		"""
+		pass
+
 	@property
 	def environ(self):
 		"""

File gentoopm/paludispm/pkg.py

View file
 		return SpaceSepTuple(k.parse_value())
 
 	@property
+	def homepages(self):
+		spec = self._pkg.homepage_key().parse_value()
+		return SpaceSepTuple([str(x) for x in spec])
+
+	@property
 	def slot(self):
 		k = self._pkg.slot_key()
 		return str(k.parse_value())

File gentoopm/pkgcorepm/pkg.py

View file
 		return SpaceSepTuple(l)
 
 	@property
+	def homepages(self):
+		return SpaceSepTuple(self._pkg.homepage)
+
+	@property
 	def slotted(self):
 		return PkgCoreAtom(self._pkg.slotted_atom)
 

File gentoopm/portagepm/pkg.py

View file
 		return PortagePackageVersion(self._cpv)
 
 	def _aux_get(self, *keys):
-		val = self._dbapi.aux_get(self._cpv, keys)
+		val = [str(x) for x
+				in self._dbapi.aux_get(self._cpv, keys)]
 		if len(keys) == 1:
 			return val[0]
 		else:
 
 	@property
 	def inherits(self):
-		return SpaceSepTuple(str(self._aux_get('INHERITED')))
+		return SpaceSepTuple(self._aux_get('INHERITED'))
+
+	@property
+	def homepages(self):
+		return SpaceSepTuple(self._aux_get('HOMEPAGE'))
 
 	@property
 	def slot(self):
 		return self._dbapi.getRepositoryName(self._tree)
 
 	def _aux_get(self, *keys):
-		val = self._dbapi.aux_get(self._cpv, keys,
-				mytree = self._tree)
+		val = [str(x) for x in self._dbapi.aux_get
+				(self._cpv, keys, mytree = self._tree)]
 		if len(keys) == 1:
 			return val[0]
 		else: