euscan-ng/pym/euscan/handlers/__init__.py

25 lines
562 B
Python
Raw Normal View History

from euscan.handlers import generic, php, pypi, rubygem, kde, cpan, github
handlers = [kde, php, pypi, rubygem, cpan, github, generic]
2012-04-28 18:16:05 +02:00
def find_best_handler(cpv, url):
for handler in handlers:
if handler.can_handle(cpv, url):
return handler
return None
2012-04-28 18:16:05 +02:00
def scan(cpv, url):
handler = find_best_handler(cpv, url)
if handler:
return handler.scan(cpv, url)
return []
2012-04-28 18:16:05 +02:00
def brute_force(cpv, url):
handler = find_best_handler(cpv, url)
if handler:
return handler.brute_force(cpv, url)
return []