/[qa]/trunk/pts/www/bin/other_to_xml.py
ViewVC logotype

Diff of /trunk/pts/www/bin/other_to_xml.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1772 by zack, Fri Nov 30 01:02:21 2007 UTC revision 1773 by zack, Sat Dec 1 17:56:06 2007 UTC
# Line 126  if os.path.exists(dir + "/patches.ubuntu Line 126  if os.path.exists(dir + "/patches.ubuntu
126          patches[package]['ubuntu'] = (version, "http://patches.ubuntu.com/" + rel_url)          patches[package]['ubuntu'] = (version, "http://patches.ubuntu.com/" + rel_url)
127      f.close()      f.close()
128    
129    # read low threshold NMU infos
130    def read_low_threshold_nmu(fname):
131        emails = []
132        if os.path.exists(fname):
133            f = open(fname)
134            devel_php_RE = \
135                re.compile(r'http://qa\.debian\.org/developer\.php\?login=([^\s&]+)')
136            word_RE = re.compile(r'^\w+$')
137            for line in f.readlines():
138                match = devel_php_RE.search(line)
139                while match:    # look for several matches on the same line
140                    email = None
141                    login = match.group(1)
142                    if word_RE.match(login):
143                        email = login + '@debian.org'
144                    elif login.find('@') >= 0:
145                        email = login
146                    if email:
147                        emails.append(email)
148                    line = line[match.end():]
149                    match = devel_php_RE.search(line)
150            f.close()
151        return emails
152    
153    # write lowThresholdNmu info to a (global, i.e. not per-package) file
154    low_nmu_emails = read_low_threshold_nmu(dir + "/low_threshold_nmu.txt")
155    f = open(odir + "/low_threshold_nmu.emails.xml", 'w')
156    f.write("<emails>\n");
157    f.writelines(map(lambda s: "  <email>%s</email>\n" % s, low_nmu_emails))
158    f.write("</emails>\n");
159    f.close()
160    
161  # Create the XML documents  # Create the XML documents
162  while 1:  while 1:
163      line = sys.stdin.readline()      line = sys.stdin.readline()

Legend:
Removed from v.1772  
changed lines
  Added in v.1773

  ViewVC Help
Powered by ViewVC 1.1.5