summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-02-23 11:07:56 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-02-23 11:07:56 +0000
commitc17e7730c128ea465d0e9581a2f87a4e0c4869d3 (patch)
treee1cbac1b64d1a3ac95d14ccfd9a808b6e29a0864 /doc
parent827b21434e032d72b8353b67b737e78d013eb0c3 (diff)
downloadpython-apt-c17e7730c128ea465d0e9581a2f87a4e0c4869d3.tar.gz
* added basic depcache support
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/depcache.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/examples/depcache.py b/doc/examples/depcache.py
new file mode 100644
index 00000000..17dbf147
--- /dev/null
+++ b/doc/examples/depcache.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+# example how to deal with the depcache
+
+import apt_pkg
+
+apt_pkg.init()
+cache = apt_pkg.GetCache()
+print cache.PackageCount
+
+iter = cache["base-config"]
+print iter
+
+depcache = apt_pkg.GetDepCache(cache)
+depcache.Init()
+print depcache
+print depcache.InstCount
+
+ver= depcache.GetCandidateVer(iter)
+print ver