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 / sources.py < prev    next >
Encoding:
Python Source  |  2006-07-27  |  363 b   |  16 lines

  1. #!/usr/bin/python
  2.  
  3. import apt_pkg
  4.  
  5. apt_pkg.init()
  6.  
  7. #cache = apt_pkg.GetCache()
  8. #sources = apt_pkg.GetPkgSrcRecords(cache)
  9.  
  10. sources = apt_pkg.GetPkgSrcRecords()
  11. sources.Restart()
  12. while sources.Lookup('hello'):
  13.     print sources.Package, sources.Version, sources.Maintainer, sources.Section, `sources.Binaries`
  14.     print sources.Files
  15.     print sources.Index.ArchiveURI("")
  16.