diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-03-29 13:20:52 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-03-29 13:20:52 +0200 |
| commit | 4b74ecd4df220fcb9939445a9774bbcf6ba3212e (patch) | |
| tree | fe24df1f2b3c5c1fd3dd4dc171bbfd5d2f8bc694 /apt/progress | |
| parent | 4f1a8ff1fcd780c2d42dbc59f41ca38581e6f10c (diff) | |
| download | python-apt-4b74ecd4df220fcb9939445a9774bbcf6ba3212e.tar.gz | |
If PYTHON_APT_DEPRECATION_WARNINGS is unset, also disable the
deprecation warnings in apt_pkg directly; and don't just
disable any deprecation warning in apt/__init__.py (LP: #548623)
Diffstat (limited to 'apt/progress')
| -rw-r--r-- | apt/progress/old.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/apt/progress/old.py b/apt/progress/old.py index 4bd79f2e..2d3fdb59 100644 --- a/apt/progress/old.py +++ b/apt/progress/old.py @@ -42,8 +42,9 @@ class OpProgress(base.OpProgress): def __init__(self): base.OpProgress.__init__(self) - warnings.warn("apt.progress.OpProgress is deprecated.", - DeprecationWarning, stacklevel=2) + if "PYTHON_APT_DEPRECATION_WARNINGS" in os.environ: + warnings.warn("apt.progress.OpProgress is deprecated.", + DeprecationWarning, stacklevel=2) subOp = AttributeDeprecatedBy('subop') Op = AttributeDeprecatedBy('op') @@ -54,8 +55,9 @@ class OpTextProgress(OpProgress, text.OpProgress): def __init__(self): text.OpProgress.__init__(self) - warnings.warn("apt.progress.OpTextProgress is deprecated.", - DeprecationWarning, stacklevel=2) + if "PYTHON_APT_DEPRECATION_WARNINGS" in os.environ: + warnings.warn("apt.progress.OpTextProgress is deprecated.", + DeprecationWarning, stacklevel=2) class FetchProgress(object): @@ -75,8 +77,9 @@ class FetchProgress(object): self.totalBytes = 0 self.totalItems = 0 self.currentCPS = 0 - warnings.warn("apt.progress.FetchProgress is deprecated.", - DeprecationWarning, stacklevel=2) + if "PYTHON_APT_DEPRECATION_WARNINGS" in os.environ: + warnings.warn("apt.progress.FetchProgress is deprecated.", + DeprecationWarning, stacklevel=2) def start(self): """Called when the fetching starts.""" @@ -175,8 +178,9 @@ class CdromProgress(object): """Report the cdrom add progress.""" def __init__(self): - warnings.warn("apt.progress.CdromProgress is deprecated.", - DeprecationWarning, stacklevel=2) + if "PYTHON_APT_DEPRECATION_WARNINGS" in os.environ: + warnings.warn("apt.progress.CdromProgress is deprecated.", + DeprecationWarning, stacklevel=2) def askCdromName(self): """Ask for a cdrom name""" @@ -193,8 +197,9 @@ class DumbInstallProgress(base.InstallProgress): def __init__(self): base.InstallProgress.__init__(self) - warnings.warn("apt.progress.*InstallProgress are deprecated.", - DeprecationWarning, stacklevel=2) + if "PYTHON_APT_DEPRECATION_WARNINGS" in os.environ: + warnings.warn("apt.progress.*InstallProgress are deprecated.", + DeprecationWarning, stacklevel=2) def updateInterface(self): # *_stream were not available in the old progress reporting classes, |
