home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / python-apt / examples / desc.py < prev    next >
Encoding:
Text File  |  2006-08-14  |  437 b   |  26 lines

  1.  
  2. import apt_pkg
  3.  
  4. apt_pkg.init()
  5.  
  6. apt_pkg.Config.Set("APT::Acquire::Translation","de")
  7.  
  8. cache = apt_pkg.GetCache()
  9. depcache = apt_pkg.GetDepCache(cache)
  10.  
  11. pkg = cache["gcc"]
  12. cand = depcache.GetCandidateVer(pkg)
  13. print cand
  14.  
  15. desc = cand.TranslatedDescription
  16. print desc
  17. print desc.FileList
  18. (f,index) = desc.FileList.pop(0)
  19.  
  20. records = apt_pkg.GetPkgRecords(cache)
  21. records.Lookup((f,index))
  22. desc = records.LongDesc
  23. print len(desc)
  24. print desc
  25.  
  26.