summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-03 15:04:40 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-03 15:04:40 -0800
commitcbbab21dfdd9bee79cddaaac12d7ea5890674d81 (patch)
treea1b5a51ee92419e30528ec416892b1139ef24e7e /pym
parent400a2a983b374ec54e7b574789d1f94752581b81 (diff)
downloadportage-cbbab21dfdd9bee79cddaaac12d7ea5890674d81.tar.gz
portage-cbbab21dfdd9bee79cddaaac12d7ea5890674d81.tar.bz2
portage-cbbab21dfdd9bee79cddaaac12d7ea5890674d81.zip
Add portage._internal_caller var, and use it.
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/main.py4
-rw-r--r--pym/portage/__init__.py4
-rw-r--r--pym/portage/dbapi/porttree.py4
-rw-r--r--pym/portage/dep/__init__.py12
4 files changed, 11 insertions, 13 deletions
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 96d6a1600..c0e2d9643 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -999,8 +999,6 @@ def emerge_main(args=None):
if args is None:
args = sys.argv[1:]
- portage._disable_legacy_globals()
- portage._internal_warnings = True
# Disable color until we're sure that it should be enabled (after
# EMERGE_DEFAULT_OPTS has been parsed).
portage.output.havecolor = 0
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 96a4fa98c..169c19783 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1,5 +1,5 @@
# portage.py -- core Portage functionality
-# Copyright 1998-2012 Gentoo Foundation
+# Copyright 1998-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
VERSION="HEAD"
@@ -335,7 +335,7 @@ _bin_path = PORTAGE_BIN_PATH
_pym_path = PORTAGE_PYM_PATH
# Api consumers included in portage should set this to True.
-_internal_warnings = False
+_internal_caller = False
_sync_disabled_warnings = False
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index ebb1be87a..d8cd261b4 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -1,4 +1,4 @@
-# Copyright 1998-2012 Gentoo Foundation
+# Copyright 1998-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = [
@@ -197,7 +197,7 @@ class portdbapi(dbapi):
@property
def _event_loop(self):
- if portage._internal_warnings:
+ if portage._internal_caller:
# For internal portage usage, the global_event_loop is safe.
return global_event_loop()
else:
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 634b42bb5..916d5ea66 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -1,5 +1,5 @@
# deps.py -- Portage dependency resolution functions
-# Copyright 2003-2012 Gentoo Foundation
+# Copyright 2003-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = [
@@ -269,7 +269,7 @@ def paren_reduce(mystr):
@rtype: Array
@return: The reduced string in an array
"""
- if portage._internal_warnings:
+ if portage._internal_caller:
warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
('portage.dep.paren_reduce',), DeprecationWarning, stacklevel=2)
mysplit = mystr.split()
@@ -361,7 +361,7 @@ 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):
- if portage._internal_warnings:
+ if portage._internal_caller:
warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
('portage.dep.paren_normalize',), DeprecationWarning, stacklevel=2)
list.__init__(self)
@@ -457,7 +457,7 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
@return: The use reduced depend array
"""
if isinstance(depstr, list):
- if portage._internal_warnings:
+ if portage._internal_caller:
warnings.warn(_("Passing paren_reduced dep arrays to %s is deprecated. " + \
"Pass the original dep string instead.") % \
('portage.dep.use_reduce',), DeprecationWarning, stacklevel=2)
@@ -758,7 +758,7 @@ def dep_opconvert(deplist):
@return:
The new list with the new ordering
"""
- if portage._internal_warnings:
+ if portage._internal_caller:
warnings.warn(_("%s is deprecated. Use %s with the opconvert parameter set to True instead.") % \
('portage.dep.dep_opconvert', 'portage.dep.use_reduce'), DeprecationWarning, stacklevel=2)
@@ -789,7 +789,7 @@ def flatten(mylist):
@rtype: List
@return: A single list containing only non-list elements.
"""
- if portage._internal_warnings:
+ if portage._internal_caller:
warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
('portage.dep.flatten',), DeprecationWarning, stacklevel=2)