/[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 2421 by hertzog, Sun Sep 19 16:15:28 2010 UTC revision 2422 by geissert, Thu Sep 23 23:26:45 2010 UTC
# Line 21  from common import hash_name Line 21  from common import hash_name
21  source2binaries = {} # maps a source package to its binaries  source2binaries = {} # maps a source package to its binaries
22  binary2source = {}   # maps a binary package to its source  binary2source = {}   # maps a binary package to its source
23    
24    def read_font_reviews(fname):
25        y = yaml.load(file(fname))
26        packages = {} # maps pkg to the font review for it
27        for pkg, data in y.iteritems():
28            if data.has_key('url'):
29                packages[pkg] = data['url']
30        return packages
31    
32  def read_shortdesc(fname):  def read_shortdesc(fname):
33      global binary2source      global binary2source
34      source_descs = {} # source package -> (binary package -> short description)      source_descs = {} # source package -> (binary package -> short description)
# Line 337  for pkgname, count in read_dehs(os.path. Line 345  for pkgname, count in read_dehs(os.path.
345  # read short descriptions  # read short descriptions
346  shortdescs = read_shortdesc(os.path.join(dir, "shortdesc.txt"))  shortdescs = read_shortdesc(os.path.join(dir, "shortdesc.txt"))
347    
348    font_reviews = read_font_reviews(os.path.join(dir, "debian-font-review.yaml"))
349    
350  # Create the XML documents  # Create the XML documents
351  while 1:  while 1:
352      line = sys.stdin.readline()      line = sys.stdin.readline()
# Line 596  while 1: Line 606  while 1:
606      else:      else:
607          shortdesc_sig = ''.__hash__()          shortdesc_sig = ''.__hash__()
608    
609        # Add font review links
610        if font_reviews.has_key(pkg):
611            elt = doc.createElement("fonts")
612            elt.setAttribute('href', font_reviews[pkg])
613            root_elt.setAttribute("fonts", "yes")
614            root_elt.appendChild(elt)
615            fonts_sig = font_reviews[pkg]
616        else:
617            root_elt.setAttribute("fonts", "no")
618            fonts_sig = ''
619    
620      # Get security issues      # Get security issues
621      if security.has_key(pkg):      if security.has_key(pkg):
622          root_elt.setAttribute('security', security[pkg])          root_elt.setAttribute('security', security[pkg])
# Line 609  while 1: Line 630  while 1:
630      sig = (pts.get(pkg, "0"), dc_sig, wnpp_sig, override_sig, dehs_sig,      sig = (pts.get(pkg, "0"), dc_sig, wnpp_sig, override_sig, dehs_sig,
631              ubuntu_sig, s_rc, s_normal, s_wishlist, s_fixed, s_gift, s_help,              ubuntu_sig, s_rc, s_normal, s_wishlist, s_fixed, s_gift, s_help,
632              subsig, svnbuildstat_sig, transitions_sig, lintian_sig,              subsig, svnbuildstat_sig, transitions_sig, lintian_sig,
633              shortdesc_sig, piuparts_sig, new_queue_sig, i18n_sig, sec_sig)              shortdesc_sig, piuparts_sig, new_queue_sig, i18n_sig,
634                fonts_sig, sec_sig)
635      if sigs.has_key(pkg) and sig == sigs[pkg] and \      if sigs.has_key(pkg) and sig == sigs[pkg] and \
636              os.path.isfile("%s/%s/%s/other.xml" % (odir, hash, pkg)):              os.path.isfile("%s/%s/%s/other.xml" % (odir, hash, pkg)):
637          continue          continue

Legend:
Removed from v.2421  
changed lines
  Added in v.2422

  ViewVC Help
Powered by ViewVC 1.1.5