summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rankmirrors24
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/rankmirrors b/scripts/rankmirrors
index 90bcad87..5bec6498 100644
--- a/scripts/rankmirrors
+++ b/scripts/rankmirrors
@@ -25,16 +25,19 @@ from optparse import OptionParser
def createOptParser():
usage = "usage: %prog [options] MIRRORFILE | URL"
- description = "Ranks pacman mirrors by their connection and opening speed. Pacman mirror files are located in /etc/pacman.d/. It can also rank one mirror if the URL is provided."
- parser = OptionParser(usage=usage,description=description)
- parser.add_option("-f", "--formatted", action="store_true",
- dest = "formatted", default=False, help="output in mirror file format")
- parser.add_option("-n", dest="num", default=0,
- help="number of servers to output, 0 for all")
- parser.add_option("-u", "--url", action="store_true", dest="url",
+ description = "Ranks pacman mirrors by their connection and opening " \
+ "speed. Pacman mirror files are located in /etc/pacman.d/. It " \
+ "can also rank one mirror if the URL is provided."
+ parser = OptionParser(usage = usage, description = description)
+ parser.add_option("-f", "--formatted", action = "store_true",
+ dest = "formatted", default = False,
+ help = "output in mirror file format")
+ parser.add_option("-n", type = "int", dest = "num", default = 0,
+ help = "number of servers to output, 0 for all")
+ parser.add_option("-u", "--url", action = "store_true", dest = "url",
default=False, help="test a specific url")
- parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
- default=False, help="be verbose in output")
+ parser.add_option("-v", "--verbose", action = "store_true",
+ dest = "verbose", default = False, help ="be verbose in output")
return parser
def timeCmd(cmd):
@@ -86,7 +89,8 @@ if __name__ == "__main__":
fl = open(args[0], 'r')
serverToTime = {}
if options.formatted:
- print "# Server list generated by rankmirrors on", datetime.date.today()
+ print "# Server list generated by rankmirrors on",
+ print datetime.date.today()
else:
print 'Querying servers, this may take some time...'
for ln in fl.readlines():