euscan-ng/pym/euscan/handlers/kde.py
Corentin Chary b78e73038d euscan: add kde handler and fix some regex issues
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2011-12-30 11:34:39 +01:00

35 lines
864 B
Python

from euscan.handlers import generic
def can_handle(cpv, url):
if url.startswith('mirror://kde/'):
return True
return False
def clean_results(results):
ret = []
for path, version in results:
if version == '5SUMS':
continue
ret.append((path, version))
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)