From f3899ebe6f019defa87ceb10f704bccd64948d30 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 5 Aug 2005 09:09:57 +0000 Subject: * FutureWarning is added, example how to filter it away too. README.apt added --- apt/README | 9 --------- apt/README.apt | 21 +++++++++++++++++++++ apt/__init__.py | 7 +++---- debian/python-apt.docs | 1 + tests/apt-test.py | 3 +++ 5 files changed, 28 insertions(+), 13 deletions(-) delete mode 100644 apt/README create mode 100644 apt/README.apt create mode 100644 debian/python-apt.docs diff --git a/apt/README b/apt/README deleted file mode 100644 index d30a92bd..00000000 --- a/apt/README +++ /dev/null @@ -1,9 +0,0 @@ -This is the python interface to libapt. The API is not stable yet. - - -Style Guides: -------------- - -Follow PEP08. - -Internal variables/methods are prefixed with a "_" (e.g. _foo). diff --git a/apt/README.apt b/apt/README.apt new file mode 100644 index 00000000..bba91e7c --- /dev/null +++ b/apt/README.apt @@ -0,0 +1,21 @@ +In addition to "apt_pkg" and "apt_inst" (that are thin wrappers around +the c++ libapt code) a new python module "apt" is provided since version +0.6.13 of python-apt. + +It is a more python like interface to work with libapt (it uses apt_pkg +internally). Also there are already applications written against the new +apt python interface the API may change in the future and should not be +considered stable. If in doubt, please contact deity@lists.debian.org. + +WARNING !!! The API is not 100% stable yet !!! + + +Style Guides: +------------- + +Follow PEP08. + +Internal variables/methods are prefixed with a "_" (e.g. _foo). + + + diff --git a/apt/__init__.py b/apt/__init__.py index 2a478b34..15df6990 100644 --- a/apt/__init__.py +++ b/apt/__init__.py @@ -13,7 +13,6 @@ from apt_pkg import SizeToStr, TimeToStr, VersionCompare apt_pkg.init() -if not os.environ.has_key("PYTHON_APT_API_NOT_STABLE"): - import warnings - warnings.warn("Module apt is 100% API stable yet; ", FutureWarning) - del warnings +import warnings +warnings.warn("apt API not stable yet", FutureWarning) +del warnings diff --git a/debian/python-apt.docs b/debian/python-apt.docs new file mode 100644 index 00000000..893ab73a --- /dev/null +++ b/debian/python-apt.docs @@ -0,0 +1 @@ +apt/README.apt diff --git a/tests/apt-test.py b/tests/apt-test.py index 03fa12eb..f1bc5593 100644 --- a/tests/apt-test.py +++ b/tests/apt-test.py @@ -1,5 +1,8 @@ +import warnings +warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning) import apt + if __name__ == "__main__": progress = apt.progress.OpTextProgress() cache = apt.Cache(progress) -- cgit v1.2.3