3
from twisted.plugin import getPlugins
6
from dosage.idosage import IScraper
9
DISABLED_FILES = ['/etc/dosage/disabled',
13
for filename in DISABLED_FILES:
14
filename = os.path.expanduser(filename)
15
if os.path.exists(filename):
16
disabled.extend([line.rstrip('\n') for line in open(filename)])
19
class DisabledComicError(ValueError):
24
"""Returns a comic module object."""
26
scrapers = getPlugins(IScraper, dosage.plugins)
27
for scraper in scrapers:
28
if scraper.name == comicName:
31
raise ValueError('Comic %r not found.' % (comicName,))
35
scrapers = getPlugins(IScraper, dosage.plugins)
36
return sorted(scrapers, key=lambda s: s.name)