Revision: 19973 http://gar.svn.sourceforge.net/gar/?rev=19973&view=rev Author: wahwah Date: 2012-12-29 10:43:30 +0000 (Sat, 29 Dec 2012) Log Message: ----------- pkgdb: A new function get the list of catalogs
Modified Paths: -------------- csw/mgar/gar/v2/lib/python/rest.py Modified: csw/mgar/gar/v2/lib/python/rest.py =================================================================== --- csw/mgar/gar/v2/lib/python/rest.py 2012-12-28 18:49:14 UTC (rev 19972) +++ csw/mgar/gar/v2/lib/python/rest.py 2012-12-29 10:43:30 UTC (rev 19973) @@ -74,10 +74,18 @@ "maintainer_email": pkg["maintainer_email"], } + def GetCatalogList(self): + url = self.rest_url + self.PKGDB_APP + "/catalogs/" + data = urllib2.urlopen(url).read() + return cjson.decode(data) + def GetCatalog(self, catrel, arch, osrel): if not catrel: raise ArgumentError("Missing catalog release.") - url = self.rest_url + self.PKGDB_APP + "/catalogs/%s/%s/%s/?quick=true" % (catrel, arch, osrel) + url = ( + self.rest_url + + self.PKGDB_APP + + "/catalogs/%s/%s/%s/?quick=true" % (catrel, arch, osrel)) logging.debug("GetCatalog(): GET %s", url) try: data = urllib2.urlopen(url).read() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ devel mailing list devel@lists.opencsw.org https://lists.opencsw.org/mailman/listinfo/devel