summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-08-11 07:14:43 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-10 22:31:02 -0700
commita512a69eaa8abecd315ceefba75e7e62b43d1183 (patch)
treeda664437b525d3cc97f17b9857b5378f9fd012d4 /pym
parentfa9a70df184669ef9db2f4b10f81f805c047627f (diff)
downloadportage-a512a69eaa8abecd315ceefba75e7e62b43d1183.tar.gz
portage-a512a69eaa8abecd315ceefba75e7e62b43d1183.tar.bz2
portage-a512a69eaa8abecd315ceefba75e7e62b43d1183.zip
Add deprecation warnings for paren_reduce, strip_empty and use_reduce with paren_reduce_d dep arrays
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dep/__init__.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 59650745f..f26125af7 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -79,6 +79,8 @@ def strip_empty(myarr):
@rtype: Array
@return: The array with empty elements removed
"""
+ warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
+ ('portage.dep.strip_empty',), DeprecationWarning)
return [x for x in myarr if x]
def paren_reduce(mystr):
@@ -95,6 +97,8 @@ def paren_reduce(mystr):
@rtype: Array
@return: The reduced string in an array
"""
+ warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
+ ('portage.dep.paren_reduce',), DeprecationWarning)
mysplit = mystr.split()
level = 0
stack = [[]]
@@ -160,6 +164,8 @@ class paren_normalize(list):
"""Take a dependency structure as returned by paren_reduce or use_reduce
and generate an equivalent structure that has no redundant lists."""
def __init__(self, src):
+ warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
+ ('portage.dep.paren_normalize',), DeprecationWarning)
list.__init__(self)
self._zap_parens(src, self)
@@ -233,7 +239,12 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
@rtype: List
@return: The use reduced depend array
"""
-
+ if isinstance(depstr, list):
+ warnings.warn(_("Passing paren_reduced dep arrays to %s is deprecated. " + \
+ "Pass the original dep string instead.") % \
+ ('portage.dep.use_reduce',), DeprecationWarning)
+ depstr = paren_enclose(depstr)
+
def is_active(conditional):
if conditional.startswith("!"):
flag = conditional[1:-1]