home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / python-apt / examples / cdrom.py < prev    next >
Encoding:
Python Source  |  2009-03-30  |  421 b   |  28 lines

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