summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-06-14 11:31:56 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-06-14 11:31:56 +0200
commit204ba672314d9ed07ca76770a32a6af5fbd67c25 (patch)
treef427cec965fcd27822fae3617478768d4f0f26ea /doc
parentbe05af84c65c7d4bae3cbd949304b9dd7020054f (diff)
parent3c2d0313a45668770e7cb2993dc092fb4e711bb7 (diff)
downloadpython-apt-204ba672314d9ed07ca76770a32a6af5fbd67c25.tar.gz
* build against the new apt
* support for new "aptsources" pythn module (thanks to Sebastian Heinlein) * merged support for translated package descriptions * merged support for automatic removal of unused dependencies * merged http://glatzor.de/bzr/python-apt/sebi: - this means that the new aptsources modules is available * support translated pacakge descriptions * support automatic dependency information * python/depcache.cc: - "IsGarbage()" method added (to support auto-mark)
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/desc.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/examples/desc.py b/doc/examples/desc.py
new file mode 100644
index 00000000..87b9473b
--- /dev/null
+++ b/doc/examples/desc.py
@@ -0,0 +1,25 @@
+
+import apt_pkg
+
+apt_pkg.init()
+
+apt_pkg.Config.Set("APT::Acquire::Translation","de")
+
+cache = apt_pkg.GetCache()
+depcache = apt_pkg.GetDepCache(cache)
+
+pkg = cache["gcc"]
+cand = depcache.GetCandidateVer(pkg)
+print cand
+
+desc = cand.TranslatedDescription
+print desc
+print desc.FileList
+(f,index) = desc.FileList.pop(0)
+
+records = apt_pkg.GetPkgRecords(cache)
+records.Lookup((f,index))
+desc = records.LongDesc
+print len(desc)
+print desc
+