euscan-ng/pym/euscan/handlers/__init__.py
Michał Górny 7cbe517a70 Initial support for github downloads.
Right now, it just handles ebuilds using mirror://github.
2012-06-14 12:34:39 +02:00

25 lines
562 B
Python

from euscan.handlers import generic, php, pypi, rubygem, kde, cpan, github
handlers = [kde, php, pypi, rubygem, cpan, github, 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 []