| 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. |