| 1 |
#!/usr/bin/python2.2 |
#!/usr/bin/python |
| 2 |
|
# -*- coding: utf8 -*- |
| 3 |
|
|
| 4 |
# Make sure tabs expand to 8 spaces in vim |
# Make sure tabs expand to 8 spaces in vim |
| 5 |
# vim: expandtab |
# vim: expandtab |
| 6 |
|
|
| 7 |
# Copyright 2002 Raphaël Hertzog |
# Copyright 2002 Raphaël Hertzog |
| 8 |
# This file is distributed under the terms of the General Public License |
# This file is distributed under the terms of the General Public License |
| 9 |
# version 2 or (at your option) any later version. |
# version 2 or (at your option) any later version. |
| 10 |
|
|
| 21 |
cleared = cleared.replace("<=", "<="); |
cleared = cleared.replace("<=", "<="); |
| 22 |
cleared = cleared.replace(">>", ">>"); |
cleared = cleared.replace(">>", ">>"); |
| 23 |
cleared = cleared.replace("<<", "<<"); |
cleared = cleared.replace("<<", "<<"); |
| 24 |
|
# Remove the tags |
| 25 |
while cleared.find("<") != -1 and cleared.find(">") != -1: |
while cleared.find("<") != -1 and cleared.find(">") != -1: |
| 26 |
cleared = cleared[:cleared.find("<")] + cleared[cleared.find(">")+1:] |
cleared = cleared[:cleared.find("<")] + cleared[cleared.find(">")+1:] |
| 27 |
|
# But I really want the output in plain text |
| 28 |
|
cleared = cleared.replace(">=", ">="); |
| 29 |
|
cleared = cleared.replace("<=", "<="); |
| 30 |
|
cleared = cleared.replace(">>", ">>"); |
| 31 |
|
cleared = cleared.replace("<<", "<<"); |
| 32 |
return cleared |
return cleared |
| 33 |
|
|
| 34 |
# Load the list of excuses generated last time |
# Load the list of excuses generated last time |
| 78 |
if not subline: continue |
if not subline: continue |
| 79 |
subline = subline.strip() |
subline = subline.strip() |
| 80 |
if subline.find("Maintainer:") != -1: continue |
if subline.find("Maintainer:") != -1: continue |
| 81 |
elif subline.find("Too young,") != -1: |
elif subline.find("Too young, only") != -1: |
| 82 |
words = subline.split() |
words = subline.split() |
| 83 |
main_elt.setAttribute("age", words[3]) |
main_elt.setAttribute("age", words[3]) |
| 84 |
main_elt.setAttribute("limit", words[5]) |
main_elt.setAttribute("limit", words[5]) |
| 92 |
words = subline.split() |
words = subline.split() |
| 93 |
main_elt.setAttribute("age", words[0]) |
main_elt.setAttribute("age", words[0]) |
| 94 |
main_elt.setAttribute("limit", words[4]) |
main_elt.setAttribute("limit", words[4]) |
| 95 |
main_elt.setAttribute("problematic", "yes") |
# Being at the last day isn't yet problematic |
| 96 |
|
if words[0] != words[4]: |
| 97 |
|
main_elt.setAttribute("problematic", "yes") |
| 98 |
subline = striphtml(subline) |
subline = striphtml(subline) |
| 99 |
sub_elt = doc.createElement("item") |
sub_elt = doc.createElement("item") |
| 100 |
sub_elt.appendChild(doc.createTextNode(subline)) |
sub_elt.appendChild(doc.createTextNode(subline)) |
| 104 |
start = subline.find('href="http://') |
start = subline.find('href="http://') |
| 105 |
if start != -1: |
if start != -1: |
| 106 |
url = subline[start+6:subline.find('"',start+6)] |
url = subline[start+6:subline.find('"',start+6)] |
| 107 |
|
# Manage broken links provided by the testing scripts |
| 108 |
|
url = string.replace(url, "+", "%2B") |
| 109 |
sub_elt.setAttribute("url", url) |
sub_elt.setAttribute("url", url) |
| 110 |
start = subline.find('href="#') |
start = subline.find('href="#') |
| 111 |
if start != -1: |
if start != -1: |