~evfool/software-properties/lintianfixes

« back to all changes in this revision

Viewing changes to softwareproperties/gtk/DialogMirror.py

  • Committer: Michael Vogt
  • Date: 2009-01-08 16:09:39 UTC
  • Revision ID: michael.vogt@ubuntu.com-20090108160939-q1p6zy2jt5mjz0kb
* softwareproperties/gtk/DialogMirror.py:
  - fixes in the mirror speed test for small sets of 
    mirrors

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import threading
29
29
import string
30
30
import re
31
 
import random
 
31
from random import randint
32
32
 
33
33
import dialogs
34
34
from softwareproperties.MirrorTest import MirrorTest
310
310
                                              borders=(0, 0.5),
311
311
                                              mod=(0,7))
312
312
            # Add two random mirrors to the download test
313
 
            results_ping.append([0, 0, self.mirrors[random.randint(1, len(self.mirrors))]])
314
 
            results_ping.append([0, 0, self.mirrors[random.randint(1, len(self.mirrors))]])
 
313
            size = len(self.mirrors)
 
314
            if size > 1:
 
315
                    results_ping.append([0, 0, self.mirrors[randint(1,size-1)]])
 
316
                    results_ping.append([0, 0, self.mirrors[randint(1,size-1)]])
315
317
            results = self.run_download_test(map(lambda r: r[2], results_ping),
316
318
                                             borders=(0.5, 1),
317
319
                                             mod=(MirrorTest.todo,