From af62a9b72731db2335bb875f509b7fed7d208b4b Mon Sep 17 00:00:00 2001 From: matteo Date: Sun, 8 Jun 2014 23:18:50 +0200 Subject: it directly queries maintdb.mageia.org to retrieve the package owner (no more mgarepo invokation) --- modules/contribfinder.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/contribfinder.py b/modules/contribfinder.py index 7b43d755..bfe06b3c 100755 --- a/modules/contribfinder.py +++ b/modules/contribfinder.py @@ -4,9 +4,9 @@ ############################################################################# # # contribfinder.py - Find Mageia Contributors information -# A trivial python script that queries the maintainers database -# invoking mgarepo. The GUI uses libyui thus contribfinder is able -# to comfortably behave like a native gtk or qt5 or ncurses application :-) +# A trivial python script that queries the maintainers database. +# The GUI uses libyui thus contribfinder is able to +# comfortably behave like a native gtk or qt5 or ncurses application :-) # # License: GPLv3 # Author: Matteo Pasotti, @@ -14,7 +14,7 @@ import sys import os -from subprocess import check_output, STDOUT, call +import httplib2 ########### # imports # @@ -72,9 +72,14 @@ class mainGui(): result = output return result - def invokeMgaRepo(self,pkgname): + def queryMaintDB(self,pkgname): try: - retoutput = check_output(['mgarepo','maintdb','get',pkgname],stderr=STDOUT) + dlurl = 'http://maintdb.mageia.org/' + pkgname + h = httplib2.Http() + resp, content = h.request(dlurl, 'GET') + if resp.status != 200: + raise Exception('Package cannot be found in maintdb') + retoutput = content.rstrip('\n') except: retoutput = "No contributors found" return retoutput @@ -99,7 +104,7 @@ class mainGui(): #self.dialog.startMultipleChanges() #self.rtinformations.setValue("Loading...") #self.dialog.doneMultipleChanges() - self.contributor = self.stripErrMessages(self.invokeMgaRepo(self.txtpkgname.value())) + self.contributor = self.stripErrMessages(self.queryMaintDB(self.txtpkgname.value())) if(cmp(self.contributor.strip(),"")!=0): outstr = 'Maintainer: %s
e-mail: %s@mageia.org' % (self.contributor,self.contributor,self.contributor,self.contributor) else: -- cgit v1.2.1