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 / indexfile.py < prev    next >
Encoding:
Text File  |  2006-07-27  |  470 b   |  22 lines

  1.  
  2. import apt_pkg
  3.  
  4. apt_pkg.init()
  5.  
  6. sources = apt_pkg.GetPkgSourceList()
  7. sources.ReadMainList()
  8.  
  9. cache = apt_pkg.GetCache()
  10. depcache = apt_pkg.GetDepCache(cache)
  11. pkg = cache["libimlib2"]
  12. cand = depcache.GetCandidateVer(pkg)
  13. for (f,i) in cand.FileList:
  14.     index = sources.FindIndex(f)
  15.     print index
  16.     if index:
  17.         print index.Size
  18.         print index.IsTrusted
  19.         print index.Exists
  20.         print index.HasPackages
  21.         print index.ArchiveURI("some/path")
  22.