From 26447c46440f31a676a6079cc76b0ef81ff50a75 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 2 Sep 2010 14:10:51 -0700 Subject: [PATCH] Bug #335620 - Add backward compatible config.virtuals and virts_p properties, and trigger a DeprecationWarning if they are accessed. --- pym/portage/package/ebuild/config.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 6ccb1da5f..22edda68e 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1977,6 +1977,20 @@ class config(object): myflags.difference_update(self.usemask) self.configlist[-1]["USE"]= " ".join(sorted(myflags)) + @property + def virts_p(self): + warnings.warn("portage config.virts_p attribute " + \ + "is deprecated, use config.get_virts_p()", + DeprecationWarning, stacklevel=2) + return self.get_virts_p() + + @property + def virtuals(self): + warnings.warn("portage config.virtuals attribute " + \ + "is deprecated, use config.getvirtuals()", + DeprecationWarning, stacklevel=2) + return self.getvirtuals() + def get_virts_p(self): return self._virtuals_manager.get_virts_p() -- 2.26.2