diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-10-28 21:17:11 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-10-28 21:17:11 -0700 |
commit | 3cfb2bc711d820fcef376aee170de560d8195819 (patch) | |
tree | 087687d6b3c43cfe4d81a785c308b20f22b9005b /pym/portage/dbapi/porttree.py | |
parent | 81e1f72cc7c749b4c46bac995e144678dea2d3fe (diff) | |
download | portage-3cfb2bc711d820fcef376aee170de560d8195819.tar.gz portage-3cfb2bc711d820fcef376aee170de560d8195819.tar.bz2 portage-3cfb2bc711d820fcef376aee170de560d8195819.zip |
Deprecate unused 'virtual' constructor parameters
Diffstat (limited to 'pym/portage/dbapi/porttree.py')
-rw-r--r-- | pym/portage/dbapi/porttree.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index fc7feb3ba..5c45d97c7 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -1064,7 +1064,7 @@ def close_portdbapi_caches(): portage.process.atexit_register(portage.portageexit) class portagetree(object): - def __init__(self, root=None, virtual=None, settings=None): + def __init__(self, root=None, virtual=DeprecationWarning, settings=None): """ Constructor for a PortageTree @@ -1087,8 +1087,14 @@ class portagetree(object): "settings['ROOT'] instead.", DeprecationWarning, stacklevel=2) + if virtual is not DeprecationWarning: + warnings.warn("The 'virtual' parameter of the " + "portage.dbapi.porttree.portagetree" + " constructor is unused", + DeprecationWarning, stacklevel=2) + self.portroot = settings["PORTDIR"] - self.virtual = virtual + self.__virtual = virtual self.dbapi = portdbapi(mysettings=settings) @property @@ -1100,6 +1106,14 @@ class portagetree(object): DeprecationWarning, stacklevel=3) return self.settings['ROOT'] + @property + def virtual(self): + warnings.warn("The 'virtual' attribute of " + \ + "portage.dbapi.porttree.portagetree" + \ + " is deprecated.", + DeprecationWarning, stacklevel=3) + return self.__virtual + def dep_bestmatch(self,mydep): "compatibility method" mymatch = self.dbapi.xmatch("bestmatch-visible",mydep) |