euscan-ng/pym/euscan/handlers/url/__init__.py
volpino 12bf1fc75b euscan: Redesigning the handlers layout
Signed-off-by: volpino <fox91@anche.no>
2012-07-26 10:44:10 +02:00

20 lines
445 B
Python

"""
Url wide handlers for scanning upstream
"""
import pkgutil
handlers = []
# autoimport all modules in this directory and append them to handlers list
for loader, module_name, is_pkg in pkgutil.walk_packages(__path__):
module = loader.find_module(module_name).load_module(module_name)
handlers.append(module)
# sort handlers by priority
handlers = sorted(
handlers,
key=lambda handler: handler.PRIORITY,
reverse=True
)