From 124f4789fb81c5671848df4b789bb44e812c8591 Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Tue, 25 May 2010 13:00:58 +0200 Subject: [PATCH] Allow _emerge.Package.iuse.is_valid_flag() to take a list of flags --- pym/_emerge/Package.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index b75018605..93b86f10b 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -207,13 +207,18 @@ class Package(Task): self.disabled = frozenset(disabled) self.all = frozenset(chain(enabled, disabled, other)) - def is_valid_flag(self, flag): + def is_valid_flag(self, flags): """ - @returns: True if flag is a valid USE value which may + @returns: True if all flags are valid USE values which may be specified in USE dependencies, False otherwise. """ - return flag in self.all or \ - self._iuse_implicit_regex.match(flag) is not None + if isinstance(flags, basestring): + flags = [flags] + for flag in flags: + if not flag in self.all and \ + self._iuse_implicit_regex.match(flag) is None: + return False + return True def _get_hash_key(self): hash_key = getattr(self, "_hash_key", None) -- 2.26.2