euscan-ng/pym/euscan/handlers/__init__.py
Corentin Chary b0ccdd2157 euscan: new cpan handler
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
2012-04-20 17:27:16 +02:00

22 lines
545 B
Python

from euscan.handlers import generic, php, pypi, rubygem, kde, cpan
handlers = [ kde, php, pypi, rubygem, cpan, generic ]
def find_best_handler(cpv, url):
for handler in handlers:
if handler.can_handle(cpv, url):
return handler
return None
def scan(cpv, url):
handler = find_best_handler(cpv, url)
if handler:
return handler.scan(cpv, url)
return []
def brute_force(cpv, url):
handler = find_best_handler(cpv, url)
if handler:
return handler.brute_force(cpv, url)
return []