X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dakweb%2Fqueries%2Fsuite.py;fp=dakweb%2Fqueries%2Fsuite.py;h=5446f699b8f622d39a0bfbf1b7343de979bbc325;hb=e41ae8d5a5fd9c204711a36b47e0593312da8c75;hp=245b879c8ea2c677f89f90d3e2b5922644f8aac1;hpb=a85a084aa8c7e04f8f438ff51ea35f94f3b33247;p=dak.git diff --git a/dakweb/queries/suite.py b/dakweb/queries/suite.py index 245b879c..5446f699 100644 --- a/dakweb/queries/suite.py +++ b/dakweb/queries/suite.py @@ -1,4 +1,11 @@ -#!/usr/bin/python +""" Suite related queries + +@contact: Debian FTPMaster +@copyright: 2014 Mark Hymers +@license: GNU General Public License version 2 or later + +@newfield maps: Mapping, Mappings +""" import bottle import json @@ -6,18 +13,25 @@ import json from daklib.dbconn import DBConn, Suite from dakweb.webregister import QueryRegister + @bottle.route('/suites') def suites(): """ - suites() + Give information about all known suites. - returns: list of dictionaries + @maps: name maps to Suite: in the release file + @maps: codename maps to Codename: in the release file. + @maps: dakname is an internal name and should not be relied upon. - Give information about all known suites. + @rtype: list of dictionaries + @return: Dictionaries made out of + - name + - codename + - dakname + - archive + - architectures + - components - name maps to Suite: in the release file - codename maps to Codename: in the release file. - dakname is an internal name and should not be relied upon. """ s = DBConn().session() @@ -41,14 +55,27 @@ QueryRegister().register_path('/suites', suites) @bottle.route('/suite/') def suite(suite=None): """ - suite(suite) - - returns: dictionary - Gives information about a single suite. Note that this routine will look up a suite first by the main suite_name, but then also by codename if no suite is initially found. It can therefore be used to canonicalise suite - names + names. + + @type suite: string + @param suite: Name or codename of the suite. + @see: L{I{suites}} on how to receive a list of valid suites. + + @maps: name maps to Suite: in the release file + @maps: codename maps to Codename: in the release file. + @maps: dakname is an internal name and should not be relied upon. + + @rtype: dictionary + @return: A dictionary of + - name + - codename + - dakname + - archive + - architectures + - components """ if suite is None: @@ -90,4 +117,3 @@ def suite(suite=None): return json.dumps(so) QueryRegister().register_path('/suite', suite) -