コード例 #1
0
def getInstanceBySetting(setting):
    if setting.type == "sabnzbd":
        return Sabnzbd(setting)
    if setting.type == "nzbget":
        return Nzbget(setting)
    raise DownloaderNotFoundException("No downloader with type %s found" %
                                      setting.type)
コード例 #2
0
def getDownloaderInstanceByName(name):
    for i in config.settings.downloaders:
        if i.name == name:
            return getInstanceBySetting(i)
    raise DownloaderNotFoundException("No downloader with name %s found" % name)