/[qa]/trunk/pts/www/cgi-bin/soap-alpha.cgi
ViewVC logotype

Diff of /trunk/pts/www/cgi-bin/soap-alpha.cgi

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

revision 2057 by zack, Sat Nov 29 11:51:50 2008 UTC revision 2058 by zack, Sat Nov 29 15:20:51 2008 UTC
# Line 25  def latest_version(source): Line 25  def latest_version(source):
25      nodes = as_xpath("//*[@id='latest_version']/child::text()", source)      nodes = as_xpath("//*[@id='latest_version']/child::text()", source)
26      return to_string(singleton(nodes))      return to_string(singleton(nodes))
27    
28    def versions(source):
29        """
30        Return all the (known) versions of a given source package.
31    
32        @type source: C{str}
33        @param source: source package name
34        @rtype: C{dict}
35        @return: dictionary mapping suite names to the latest known
36          version of the package in those suites.
37    
38          E.g.: C{{'stable': '1.2-4', 'testing': '1.5-6', 'unstable': '1.5-7'}}
39        """
40        nodes = as_xpath("//span[starts-with(@class,'srcversion')]/@title "
41                         "| //span[starts-with(@class,'srcversion')]/child::text()",
42                         source)
43        nodes.reverse()
44        versions = {}
45        while nodes:
46            version = to_string(nodes.pop())
47            suite = to_string(nodes.pop())
48            versions[version] = suite
49        return versions
50    
51  def maintainer_name(source):  def maintainer_name(source):
52      """      """
53      Return the name of the maintainer of a given source package.      Return the name of the maintainer of a given source package.

Legend:
Removed from v.2057  
changed lines
  Added in v.2058

  ViewVC Help
Powered by ViewVC 1.1.5