diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-08-14 16:39:54 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-08-14 16:39:54 +0200 |
| commit | 283dade78ce3cb31d09dcbc3407b83eedb6d59e4 (patch) | |
| tree | e34390e709d69336a26c57eecee72ab39783c999 /doc/examples/desc.py | |
| parent | 1ec002106f5db5e855ab8053a549a53b1e8dc8e3 (diff) | |
| parent | fd31f9b76508663d24c9a5684784cff18c235170 (diff) | |
| download | python-apt-283dade78ce3cb31d09dcbc3407b83eedb6d59e4.tar.gz | |
* merged the ddtp support
Diffstat (limited to 'doc/examples/desc.py')
| -rw-r--r-- | doc/examples/desc.py | 25 |
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 + |
