# Path: kibitzr/fetcher/base.py
# class BasePromoter(object):
#     """
#     Promoters are filtered by the result of is_applicable call,
#     then sorted by PRIORITY.
#     The one with highest PRIORITY is chosen for check.
#     """
# 
#     PRIORITY = 10
# 
#     def __init__(self, conf):
#         self.conf = conf
# 
#     @staticmethod
#     def is_applicable(conf):
#         """Return whether this promoter is applicable for given conf"""
#         return bool(conf)
# 
#     def log_announcement(self):
#         logger.info(u"Fetching %s using %s",
#                     self.conf['name'],
#                     self.__class__.__name__)
# 
#     def fetch(self):
#         self.log_announcement()
# 
#     def __call__(self):
#         return self.fetch()


import logging
import entrypoints
from .base import BasePromoter
        from .simple import requests_fetcher
        from .browser.fetcher import firefox_fetcher
        from .script import fetch_by_script



logger = logging.getLogger(__name__)


def load_promoters():
    """Return list of available promoters"""
    builtins = [
        RequestsPromoter,
        FirefoxPromoter,
        ScriptPromoter,
    ]
    return builtins + load_extensions()


def load_extensions():
    """Return list of fetcher promoters defined in Kibitzr extensions"""
    return [
        point.load()
        for point in entrypoints.get_group_all("kibitzr.fetcher")
    ]



# Path: kibitzr/fetcher/base.py
# class BasePromoter(object):
#     """
#     Promoters are filtered by the result of is_applicable call,
#     then sorted by PRIORITY.
#     The one with highest PRIORITY is chosen for check.
#     """
# 
#     PRIORITY = 10
# 
#     def __init__(self, conf):
#         self.conf = conf
# 
#     @staticmethod
#     def is_applicable(conf):
#         """Return whether this promoter is applicable for given conf"""
#         return bool(conf)
# 
#     def log_announcement(self):
#         logger.info(u"Fetching %s using %s",
#                     self.conf['name'],
#                     self.__class__.__name__)
# 
#     def fetch(self):
#         self.log_announcement()
# 
#     def __call__(self):
#         return self.fetch()


# Path: kibitzr/fetcher/loader.py
import logging
import entrypoints
from .base import BasePromoter
        from .simple import requests_fetcher
        from .browser.fetcher import firefox_fetcher
        from .script import fetch_by_script




logger = logging.getLogger(__name__)


def load_promoters():
    """Return list of available promoters"""
    builtins = [
        RequestsPromoter,
        FirefoxPromoter,
        ScriptPromoter,
    ]
    return builtins + load_extensions()


def load_extensions():
    """Return list of fetcher promoters defined in Kibitzr extensions"""
    return [
        point.load()
        for point in entrypoints.get_group_all("kibitzr.fetcher")
    ]



class URLPromoter(BasePromoter):