svn commit: samba-web r336 - in trunk/scripts: .
deryck at samba.org
deryck at samba.org
Thu Sep 16 04:18:49 GMT 2004
Author: deryck
Date: 2004-09-16 04:18:49 +0000 (Thu, 16 Sep 2004)
New Revision: 336
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-web&path=/trunk/scripts&rev=336&nolog=1
Log:
Second pass at writing the most recent 10 headlines to
headlines.html to be included on samba.org main page.
Just needed a string-test backwards-compatible to Python2.1.
--deryck
Modified:
trunk/scripts/updateNews.py
Changeset:
Modified: trunk/scripts/updateNews.py
===================================================================
--- trunk/scripts/updateNews.py 2004-09-15 21:43:34 UTC (rev 335)
+++ trunk/scripts/updateNews.py 2004-09-16 04:18:49 UTC (rev 336)
@@ -138,21 +138,23 @@
archive(topic, topics_files[topic])
-# # Create headlines for samba.org from last ten news items
-# headlines = open('headlines.html', 'w')
-# headlines.write('<ul class="news">\n')
-#
-# for line in open('index.html', 'r').readlines():
-# if '<h3>' in line and len(open('headlines.html', 'r').readlines()) < 10:
-# # Search for text between quotes
-# link = re.search('(?<=\")\S+(?=\")', line)
-# # Search for text between > and </a
-# title = re.search('(?<=\"\>).+(?=\<\/a)', line)
-# headlines = open('headlines.html', 'a')
-# headlines.write('<li><a href="/samba/news/#' + link.group(0) + '">' + title.group(0) + '</a></li>\n')
-# else:
-# continue
-#
-#
-# headlines = open('headlines.html', 'a')
-# headlines.write('</ul>\n')
+# Create headlines for samba.org from last ten news items
+headlines = open('headlines.html', 'w')
+headlines.write('<ul class="news">\n')
+
+for line in open('index.html', 'r').readlines():
+ if line.find('<h3>') > -1 and len(open('headlines.html',
+'r').readlines()) < 10:
+ # Search for text between quotes
+ link = re.search('(?<=\")\S+(?=\")', line)
+ # Search for text between > and </a
+ title = re.search('(?<=\"\>).+(?=\<\/a)', line)
+ headlines = open('headlines.html', 'a')
+ headlines.write('<li><a href="/samba/news/#' + link.group(0) + '">'
++ title.group(0) + '</a></li>\n')
+ else:
+ continue
+
+
+headlines = open('headlines.html', 'a')
+headlines.write('</ul>\n')
More information about the samba-cvs
mailing list