svn commit: samba-web r466 - in trunk/scripts: .

deryck at samba.org deryck at samba.org
Fri Dec 10 21:05:25 GMT 2004


Author: deryck
Date: 2004-12-10 21:05:25 +0000 (Fri, 10 Dec 2004)
New Revision: 466

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=466

Log:

Preserve the sort done on web_hosts when culling urls from the file.

--deryck

Modified:
   trunk/scripts/js_redirect.py


Changeset:
Modified: trunk/scripts/js_redirect.py
===================================================================
--- trunk/scripts/js_redirect.py	2004-12-10 20:44:55 UTC (rev 465)
+++ trunk/scripts/js_redirect.py	2004-12-10 21:05:25 UTC (rev 466)
@@ -6,18 +6,18 @@
 
 os.chdir('/data/httpd/html/samba')
 hosts = open('web_hosts.html', 'r').readlines()
-mirrors = {}  
+mirrors = []  
 
 for line in hosts:
     if line[:4] == '<li>':
         parts = re.match('<li><a href=(.*)samba.html">(.*)</a>', line)
-        # Store as url/mirror_name pairs
-        mirrors[parts.group(1)] = parts.group(2)
+        # Make list of mirror_name/url pairs to preserve web_hosts sort. 
+        mirrors.append((parts.group(2), parts.group(1)))
 
 # For drop-down mirror selection list
 menu = open('menu_options.html', 'w')
-for m in mirrors.keys():
-    menu.write('<option value=' + m + '">' + mirrors[m] + '</option>\n')
+for m in mirrors:
+    menu.write('<option value=' + m[1] + '">' + m[0] + '</option>\n')
 menu.close()
 
 



More information about the samba-cvs mailing list