From 432c31f039870b785cb0760c2a8b1ce530326c17 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Tue, 4 Oct 2011 19:04:56 +0000 Subject: add function to get maintainer of a package using http --- MgaRepo/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MgaRepo/util.py b/MgaRepo/util.py index e8aef0a..cc08274 100644 --- a/MgaRepo/util.py +++ b/MgaRepo/util.py @@ -8,6 +8,7 @@ import sys import os import re from cStringIO import StringIO +import httplib2 #import commands # Our own version of commands' getstatusoutput(). We have a commands @@ -134,5 +135,14 @@ def rellink(src, dst): steps.extend(csrc[i:]) return os.path.sep.join(steps) +def maintdb_get(package): + dlurl = config.get("maintdb", "url", + "http://maintdb.mageia.org/") + dlurl = dlurl + "/" + package + h = httplib2.Http() + resp, content = h.request(dlurl, 'GET') + if resp.status != 200: + raise Exception('Package cannot be found in maintdb') + return content.rstrip('\n') # vim:et:ts=4:sw=4 -- cgit v1.2.1