summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-03 17:00:32 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-03 17:00:32 +0200
commit88c410f794c968cd5c50fd7e9838036e4207b88c (patch)
tree50fb8369050d9df046a1616deaae6fe103849e40 /doc
parent8d79b99c1a3338e31e8def858cee3209824ae8bf (diff)
downloadpython-apt-88c410f794c968cd5c50fd7e9838036e4207b88c.tar.gz
* basic ddtp support added
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
+