Commits

Michał Górny committed 712ead9

Drop CATEGORY from package metadata.

Please use .atom.key.category instead.

Comments (0)

Files changed (4)

gentoopm/basepm/metadata.py

 	'RESTRICT', 'PROPERTIES',
 	'REQUIRED_USE',
 	# magic ebuild-defined vars (PMS 7.4)
-	'INHERITED', 'DEFINED_PHASES',
-
-	# other useful ebuild vars
-	'CATEGORY'
+	'INHERITED', 'DEFINED_PHASES'
 )
 """ A common supported metadata key list. """
 

gentoopm/paludispm/pkg.py

 			raise NotImplementedError('Parsing %s is not supported yet.' % key)
 		else:
 			return str(m)
-
-	@property
-	def CATEGORY(self):
-		return str(self._pkg.name.category)

gentoopm/portagepm/pkg.py

 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-from portage.versions import cpv_getkey, cpv_getversion, vercmp, \
-		catsplit
+from portage.versions import cpv_getkey, cpv_getversion, vercmp
 
 from gentoopm.basepm.metadata import PMPackageMetadata
 from gentoopm.basepm.pkg import PMPackage
 			raise AttributeError('Unsupported metadata key: %s' % key)
 		return self._dbapi.aux_get(self._cpv, [key])[0]
 
-	@property
-	def CATEGORY(self):
-		return catsplit(self._cpv)[0]
-
 class PortageMetadata(PortageDBMetadata):
 	def __init__(self, cpv, dbapi, tree):
 		PortageDBMetadata.__init__(self, cpv, dbapi)

gentoopm/tests/pkg.py

 
 	def test_metadata_dict_attr(self):
 		""" Check whether metadata is accessible with dict & attrs. """
-		mks = ('EAPI', 'INHERITED', 'DESCRIPTION', 'CATEGORY')
+		mks = ('EAPI', 'INHERITED', 'DESCRIPTION')
 		for p in self._pkgs:
 			for k in mks:
 				self.assertEqual(p.metadata[k], getattr(p.metadata, k))