summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-06-10 20:11:14 +0200
committerMichael Vogt <egon@bottom>2007-06-10 20:11:14 +0200
commit9292ca0cd6081896fa72ec50eda8b2fda4bd7f29 (patch)
tree0721de51cb0bae38b61364186985abaec56a969a /doc
parente9a4095f8b5f4da8f70915b178c2a37b2b009e6d (diff)
parentfd31f9b76508663d24c9a5684784cff18c235170 (diff)
downloadpython-apt-9292ca0cd6081896fa72ec50eda8b2fda4bd7f29.tar.gz
* merged translated package descriptions branch
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
+