Commits

Michał Górny committed 8202118

Support PMAtom.blocking.

  • Participants
  • Parent commits ec043d6

Comments (0)

Files changed (5)

File gentoopm/basepm/atom.py

 		"""
 		pass
 
+	@abstractproperty
+	def blocking(self):
+		"""
+		Whether the atom represents a blocking atom.
+
+		Support for block atoms is limited. They may not be parseable from user
+		input (using L{PackageManager.Atom()}), and they should not be used as
+		arguments to matching functions.
+
+		@type: bool
+		"""
+		pass
+
 	@property
 	def associated(self):
 		"""

File gentoopm/basepm/pkg.py

 		return True
 
 	@property
+	def blocking(self):
+		return False
+
+	@property
 	def associated(self):
 		return True
 

File gentoopm/paludispm/atom.py

 		return not self._incomplete
 
 	@property
+	def blocking(self):
+		return bool(self._blocking)
+
+	@property
 	def key(self):
 		if self.complete:
 			return PaludisPackageKey(self._atom.package)

File gentoopm/pkgcorepm/atom.py

 		return isinstance(self._r, atom)
 
 	@property
+	def blocking(self):
+		# incomplete atoms can't block
+		return self.complete and self._r.blocks
+
+	@property
 	def key(self):
 		if self.complete:
 			return PkgCorePackageKey(self._r)

File gentoopm/portagepm/atom.py

 		return True
 
 	@property
+	def blocking(self):
+		return self._atom.blocker
+
+	@property
 	def key(self):
 		return PortagePackageKey(self._atom.cp)