portdbapi: deprecate unused 'visible' method
authorZac Medico <zmedico@gentoo.org>
Sat, 24 Sep 2011 22:03:07 +0000 (15:03 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 24 Sep 2011 22:03:07 +0000 (15:03 -0700)
pym/portage/dbapi/porttree.py

index 62a1e8f55b408e53db3e549416e5f0d6999041bc..9a8f50826e8bd44f1c47b3573952926d6c40d6a5 100644 (file)
@@ -962,18 +962,17 @@ class portdbapi(dbapi):
        def gvisible(self, mylist):
                warnings.warn("The 'gvisible' method of "
                        "portage.dbapi.porttree.portdbapi "
-                       "is deprecated, and the functionality "
-                       "has been combined into the 'visible' method",
+                       "is deprecated",
                        DeprecationWarning, stacklevel=2)
-               return self.visible(mylist)
+               return list(self._iter_visible(iter(mylist)))
 
        def visible(self, cpv_iter):
-               """
-               Return a list containing only visible packages.
-               """
+               warnings.warn("The 'visible' method of "
+                       "portage.dbapi.porttree.portdbapi "
+                       "is deprecated",
+                       DeprecationWarning, stacklevel=2)
                if cpv_iter is None:
                        return []
-
                return list(self._iter_visible(iter(cpv_iter)))
 
        def _iter_visible(self, cpv_iter, myrepo=None):