~bkerensa/ubuntu-release-upgrader/fix-for-1068874

« back to all changes in this revision

Viewing changes to utils/update_mirrors.py

  • Committer: Michael Vogt
  • Date: 2007-03-30 19:10:19 UTC
  • Revision ID: michael.vogt@ubuntu.com-20070330191019-cte9u1ycoielurzw
utils/update_mirrors.py:
- added software to extract the latest mirrors

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
import feedparser
 
4
import sys
 
5
 
 
6
# read what we have
 
7
current_mirrors = set()
 
8
for line in open(sys.argv[1], "r"):
 
9
    current_mirrors.add(line.strip())
 
10
 
 
11
    
 
12
outfile = open(sys.argv[1],"a")
 
13
d = feedparser.parse("https://launchpad.net/ubuntu/+archivemirrors-rss")
 
14
 
 
15
#import pprint
 
16
#pp  = pprint.PrettyPrinter(indent=4)
 
17
#pp.pprint(d)
 
18
 
 
19
for entry in d.entries:
 
20
    for link in entry.links:
 
21
        if not link.href in current_mirrors:
 
22
            outfile.write(link.href+"\n")