euscan-ng/pym/euscan/handlers/kde.py
volpino 1efeee4134 euscan: added simple support to result confidence
Confidence values are meaningless at the moment. Need to fix it.

Signed-off-by: volpino <fox91@anche.no>
2012-05-23 16:44:44 +02:00

41 lines
928 B
Python

from euscan.handlers import generic
HANDLER_NAME = "kde"
def can_handle(cpv, url):
if url.startswith('mirror://kde/'):
return True
return False
def clean_results(results):
ret = []
for path, version, confidence in results:
if version == '5SUMS':
continue
ret.append((path, version, HANDLER_NAME, confidence))
return ret
def scan(cpv, url):
results = generic.scan(cpv, url)
if url.startswith('mirror://kde/unstable/'):
url = url.replace('mirror://kde/unstable/', 'mirror://kde/stable/')
results += generic.scan(cpv, url)
return clean_results(results)
def brute_force(cpv, url):
results = generic.brute_force(cpv, url)
if url.startswith('mirror://kde/unstable/'):
url = url.replace('mirror://kde/unstable/', 'mirror://kde/stable/')
results += generic.brute_force(cpv, url)
return clean_results(results)