]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
Enable some DeprecationWarnings
authorChris Larson <chris_larson@mentor.com>
Sat, 12 Feb 2011 04:26:51 +0000 (21:26 -0700)
committerChris Larson <chris_larson@mentor.com>
Sat, 12 Feb 2011 04:26:53 +0000 (21:26 -0700)
We'll be skipping the Pending Deprecation step given our release process.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
lib/bb/__init__.py
lib/bb/msg.py
lib/bb/persist_data.py

index 0f22d15afd5345f85d307820bc1432a16eb4362a..d060002b217abb8e5a8a15d3d134de63ca73fb15 100644 (file)
@@ -96,7 +96,7 @@ def fatal(*args):
     sys.exit(1)
 
 
-def deprecated(func, name = None, advice = ""):
+def deprecated(func, name=None, advice=""):
     """This is a decorator which can be used to mark functions
     as deprecated. It will result in a warning being emmitted
     when the function is used."""
@@ -110,8 +110,8 @@ def deprecated(func, name = None, advice = ""):
     def newFunc(*args, **kwargs):
         warnings.warn("Call to deprecated function %s%s." % (name,
                                                              advice),
-                      category = PendingDeprecationWarning,
-                      stacklevel = 2)
+                      category=DeprecationWarning,
+                      stacklevel=2)
         return func(*args, **kwargs)
     newFunc.__name__ = func.__name__
     newFunc.__doc__ = func.__doc__
index 1f9ff904af2efbcbb6721b7c07f2e7c65b52edf7..a7ac850790df05bcf175244594b031e98d51c398 100644 (file)
@@ -147,8 +147,8 @@ def set_debug_domains(domainargs):
 #
 
 def debug(level, msgdomain, msg):
-    warnings.warn("bb.msg.debug will soon be deprecated in favor of the python 'logging' module",
-                  PendingDeprecationWarning, stacklevel=2)
+    warnings.warn("bb.msg.debug is deprecated in favor of the python 'logging' module",
+                  DeprecationWarning, stacklevel=2)
     level = logging.DEBUG - (level - 1)
     if not msgdomain:
         logger.debug(level, msg)
@@ -156,13 +156,13 @@ def debug(level, msgdomain, msg):
         loggers[msgdomain].debug(level, msg)
 
 def plain(msg):
-    warnings.warn("bb.msg.plain will soon be deprecated in favor of the python 'logging' module",
-                  PendingDeprecationWarning, stacklevel=2)
+    warnings.warn("bb.msg.plain is deprecated in favor of the python 'logging' module",
+                  DeprecationWarning, stacklevel=2)
     logger.plain(msg)
 
 def note(level, msgdomain, msg):
-    warnings.warn("bb.msg.note will soon be deprecated in favor of the python 'logging' module",
-                  PendingDeprecationWarning, stacklevel=2)
+    warnings.warn("bb.msg.note is deprecated in favor of the python 'logging' module",
+                  DeprecationWarning, stacklevel=2)
     if level > 1:
         if msgdomain:
             logger.verbose(msg)
@@ -175,24 +175,22 @@ def note(level, msgdomain, msg):
             loggers[msgdomain].info(msg)
 
 def warn(msgdomain, msg):
-    warnings.warn("bb.msg.warn will soon be deprecated in favor of the python 'logging' module",
-                  PendingDeprecationWarning, stacklevel=2)
+    warnings.warn("bb.msg.warn is deprecated in favor of the python 'logging' module",
+                  DeprecationWarning, stacklevel=2)
     if not msgdomain:
         logger.warn(msg)
     else:
         loggers[msgdomain].warn(msg)
 
 def error(msgdomain, msg):
-    warnings.warn("bb.msg.error will soon be deprecated in favor of the python 'logging' module",
-                  PendingDeprecationWarning, stacklevel=2)
+    warnings.warn("bb.msg.error is deprecated in favor of the python 'logging' module",
+                  DeprecationWarning, stacklevel=2)
     if not msgdomain:
         logger.error(msg)
     else:
         loggers[msgdomain].error(msg)
 
 def fatal(msgdomain, msg):
-    warnings.warn("bb.msg.fatal will soon be deprecated in favor of raising appropriate exceptions",
-                  PendingDeprecationWarning, stacklevel=2)
     if not msgdomain:
         logger.critical(msg)
     else:
index 2c424f29bc4bc5f712f6af51aab041f89d51c0b5..bd60fca7c7b6f65228c02378a96d3f5199e9e5bb 100644 (file)
@@ -106,8 +106,9 @@ class SQLTable(collections.MutableMapping):
 class PersistData(object):
     """Deprecated representation of the bitbake persistent data store"""
     def __init__(self, d):
-        warnings.warn("Use of PersistData will be deprecated in the future",
-                      category=PendingDeprecationWarning,
+        warnings.warn("Use of PersistData is deprecated.  Please use "
+                      "persist(domain, d) instead.",
+                      category=DeprecationWarning,
                       stacklevel=2)
 
         self.data = persist(d)