Add backward compatible config.pmaskdict and punmaskdict properties
authorZac Medico <zmedico@gentoo.org>
Thu, 2 Sep 2010 21:33:48 +0000 (14:33 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 2 Sep 2010 21:33:48 +0000 (14:33 -0700)
that return copies of the corresponding MaskManager attributes. This
is safe since MaskManager now stores the values in these dicts as
immutable tuples.

pym/portage/package/ebuild/config.py

index 22edda68ef763e798a93295d59f523507988a559..2f0958e2da854116ac90529fb0fd4fc96f10fe6d 100644 (file)
@@ -853,6 +853,14 @@ class config(object):
                                writemsg("!!! %s\n" % str(e),
                                        noiselevel=-1)
 
+       @property
+       def pmaskdict(self):
+               return self._mask_manager._pmaskdict.copy()
+
+       @property
+       def punmaskdict(self):
+               return self._mask_manager._punmaskdict.copy()
+
        def expandLicenseTokens(self, tokens):
                """ Take a token from ACCEPT_LICENSE or package.license and expand it
                if it's a group token (indicated by @) or just return it if it's not a