Add deprecation warnings to vartree.exists_specific_cat(), getnode(), and
authorZac Medico <zmedico@gentoo.org>
Mon, 21 Sep 2009 13:06:29 +0000 (13:06 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 21 Sep 2009 13:06:29 +0000 (13:06 -0000)
hasnode(). Use dbapi methods instead.

svn path=/main/trunk/; revision=14318

pym/portage/dbapi/vartree.py

index dcec611f03418adfdb416af169288eddedfb7796..5db04e4b1794405234a773d06fb2a745068fba49 100644 (file)
@@ -51,6 +51,7 @@ import codecs
 import re, shutil, stat, errno, copy, subprocess
 import logging
 import sys
+import warnings
 
 try:
        import cPickle as pickle
@@ -1734,6 +1735,9 @@ class vartree(object):
                return self.dbapi.cp_all()
 
        def exists_specific_cat(self, cpv, use_cache=1):
+               warnings.warn(
+                       "portage.dbapi.vartree.vartree.exists_specific_cat() is deprecated",
+                       DeprecationWarning)
                cpv = key_expand(cpv, mydb=self.dbapi, use_cache=use_cache,
                        settings=self.settings)
                a = catpkgsplit(cpv)
@@ -1754,6 +1758,9 @@ class vartree(object):
                return self.getpath(fullpackage, filename=package+".ebuild")
 
        def getnode(self, mykey, use_cache=1):
+               warnings.warn(
+                       "portage.dbapi.vartree.vartree.getnode() is deprecated",
+                       DeprecationWarning)
                mykey = key_expand(mykey, mydb=self.dbapi, use_cache=use_cache,
                        settings=self.settings)
                if not mykey:
@@ -1780,6 +1787,9 @@ class vartree(object):
 
        def hasnode(self, mykey, use_cache):
                """Does the particular node (cat/pkg key) exist?"""
+               warnings.warn(
+                       "portage.dbapi.vartree.vartree.hadnode() is deprecated",
+                       DeprecationWarning)
                mykey = key_expand(mykey, mydb=self.dbapi, use_cache=use_cache,
                        settings=self.settings)
                mysplit = catsplit(mykey)