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 / cdrom.py < prev    next >
Encoding:
Python Source  |  2006-03-02  |  420 b   |  33 lines

  1. #!/usr/bin/python
  2. # example how to deal with the depcache
  3.  
  4. import apt_pkg
  5. import sys, os
  6. import copy
  7.  
  8. from progress import CdromProgress
  9.  
  10.  
  11. # init
  12. apt_pkg.init()
  13.  
  14. cdrom = apt_pkg.GetCdrom()
  15. print cdrom
  16.  
  17. progress = CdromProgress()
  18.  
  19. (res,ident) = cdrom.Ident(progress)
  20. print "ident result is: %s (%s) " % (res, ident)
  21.  
  22. apt_pkg.Config.Set("APT::CDROM::Rename", "True")
  23. cdrom.Add(progress)
  24.  
  25.  
  26.  
  27. print "Exiting"
  28. sys.exit(0)
  29.  
  30.  
  31.  
  32.  
  33.