예제 #1
0
def determineFrom(comic_url):
    """ Return a download module determined by the URL
    """

    scheme, domain, path = web.getUrlComponents(comic_url)

    if domain == None:
        ComicError("Invalid URL")

    for engine_file in getAvailableEngineFiles():
        cengine = importlib.import_module(engine_file)
        if domain in cengine.valid_domains:
            return cengine

    raise ComicError("Unknown handler for %s" % domain)
예제 #2
0
    def __ini__(self, url):
        url = self.validateUrl(url)

        web.WebResource.__init__(self, url)
        self.domain = web.getUrlComponents(url, 2)