tags 570087 + patch thanks On Tue, 2010-02-16 at 19:39 +0800, Paul Wise wrote: > Please add a "fonts" link to the links section of the PTS. The YAML > based mapping of binary package names to font review pages is here. I've attached a naive and untested patch to implement this. I may be missing something but adding new links to the PTS seems trivial so I assume that my patch works properly. -- bye, pabs http://wiki.debian.org/PaulWise
Index: www/xsl/pts.xsl =================================================================== --- www/xsl/pts.xsl (revision 2391) +++ www/xsl/pts.xsl (working copy) @@ -913,6 +913,12 @@ </small> </li> </xsl:if> + <xsl:if test="$other/fonts/@href"> + <li> + <a title="fonts review" + href="{$other/fonts/@href}">fonts</a> + </li> + </xsl:if> </ul> </div> </xsl:template> Index: www/bin/other_to_xml.py =================================================================== --- www/bin/other_to_xml.py (revision 2391) +++ www/bin/other_to_xml.py (working copy) @@ -21,6 +21,14 @@ source2binaries = {} # maps a source package to its binaries binary2source = {} # maps a binary package to its source +def read_font_reviews(fname): + y = yaml.load(file(fname)) + packages = {} # maps pkg to the font review for it + for pkg, data in y.iteritems(): + if data.has_key('url'): + packages[pkg] = data['url'] + return packages + def read_shortdesc(fname): global binary2source source_descs = {} # source package -> (binary package -> short description) @@ -330,6 +338,8 @@ # read short descriptions shortdescs = read_shortdesc(os.path.join(dir, "shortdesc.txt")) +font_reviews = read_font_reviews(os.path.join(dir, "debian-font-review.yaml")) + # Create the XML documents while 1: line = sys.stdin.readline() @@ -581,6 +591,13 @@ else: shortdesc_sig = ''.__hash__() + # Add font review links + if font_reviews.has_key(pkg): + elt = doc.createElement("fonts") + elt.setAttribute('href', font_reviews[pkg]) + else: + root_elt.setAttribute("fonts", "no") + # Get security issues if security.has_key(pkg): root_elt.setAttribute('security', security[pkg]) Index: www/bin/update_incoming.sh =================================================================== --- www/bin/update_incoming.sh (revision 2391) +++ www/bin/update_incoming.sh (working copy) @@ -169,6 +169,9 @@ # retrieve package descriptions from UDD nice_wget http://qa.debian.org/data/pts/shortdesc.txt shortdesc.txt +# download the Debian fonts review +nice_wget http://pkg-fonts.alioth.debian.org/review/debian-font-review.yaml debian-font-review.yaml + # What more ? # Decompress all files
Attachment:
signature.asc
Description: This is a digitally signed message part