~bilalakhtar/update-manager/unity-quicklist

« back to all changes in this revision

Viewing changes to AutoUpgradeTester/randomInst.py

  • Committer: Michael Vogt
  • Date: 2011-02-23 17:11:23 UTC
  • Revision ID: michael.vogt@ubuntu.com-20110223171123-wrbx0xuqxvkporh4
merged lp:~thibault-lemaitre/ubuntu/natty/update-manager/from_pkg.isInstalled_to_pkg.is_installed
that fixes a bunch of deprecated python-apt issues (many thanks!)

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
for i in range(int(sys.argv[1])):
9
9
    while True:
10
10
        pkgname = choice(cache.keys())
11
 
        if cache[pkgname].isInstalled:
 
11
        if cache[pkgname].is_installed:
12
12
            continue
13
13
        try:
14
14
            print "Trying to install: '%s'" % pkgname
15
 
            cache[pkgname].markInstall()
 
15
            cache[pkgname].mark_install()
16
16
        except SystemError, e:
17
17
            print "Failed to install '%s' (%s)" % (pkgname,e)
18
18
            continue
19
19
        break
20
 
cache.commit(apt.progress.FetchProgress(), apt.progess.InstallProgress())
 
20
cache.commit(apt.progress.text.AcquireProgress(), 
 
21
             apt.progess.base.InstallProgress())