summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSebastian Heinlein <sebi@sebi-laptop>2007-03-22 16:09:31 +0100
committerSebastian Heinlein <sebi@sebi-laptop>2007-03-22 16:09:31 +0100
commit9e5248060b5b6f8740f5df8bcffdfdf1fc50d4a3 (patch)
tree965612d37c30e4971e4ae9ab41fc181ab0bd8235 /doc
parent89e6314a71a56fbc7eb5600036bbb957f3b48034 (diff)
parent808dfe4f1df81228fc15a18e47cffcc62a830ed6 (diff)
downloadpython-apt-9e5248060b5b6f8740f5df8bcffdfdf1fc50d4a3.tar.gz
* merge with ubuntu
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
+