diff options
| author | Sebastian Heinlein <sebi@sebi-laptop> | 2007-03-22 16:09:31 +0100 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@sebi-laptop> | 2007-03-22 16:09:31 +0100 |
| commit | 9e5248060b5b6f8740f5df8bcffdfdf1fc50d4a3 (patch) | |
| tree | 965612d37c30e4971e4ae9ab41fc181ab0bd8235 /doc | |
| parent | 89e6314a71a56fbc7eb5600036bbb957f3b48034 (diff) | |
| parent | 808dfe4f1df81228fc15a18e47cffcc62a830ed6 (diff) | |
| download | python-apt-9e5248060b5b6f8740f5df8bcffdfdf1fc50d4a3.tar.gz | |
* merge with ubuntu
Diffstat (limited to 'doc')
| -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 + |
