Some error fixes.

This commit is contained in:
Bastian Kleineidam 2012-10-11 14:17:25 +02:00
parent 87061d1fa6
commit 846299c542

14
dosage
View file

@ -112,7 +112,7 @@ def run(options, comics):
return 1 return 1
if options.modhelp: if options.modhelp:
return displayHelp(comics, options.basepath) return displayHelp(comics, options.basepath)
errors = getComics(options, comics) return getComics(options, comics)
def doList(columnList): def doList(columnList):
@ -155,20 +155,18 @@ def getScrapers(comics, basepath=None):
yield scraperclass() yield scraperclass()
elif '@@' in comics: elif '@@' in comics:
# all scrapers # all scrapers
if len(comics) > 1:
out.write("WARN: using '@@' as comic name ignores all other specified comics.\n")
for scraperclass in scraper.get_scrapers(): for scraperclass in scraper.get_scrapers():
yield scraperclass() yield scraperclass()
else: else:
# only selected # only selected
for comic in comics: for comic in comics:
c = comic.split(':', 2) if ':' in comic:
if len(c) > 1: name, index = comic.split(':', 1)
indices = c[1].split(',') indices = index.split(',')
else: else:
name = comic
indices = None indices = None
moduleName = c[0] yield scraper.get_scraper(name)(indices=indices)
yield scraper.get_scraper(moduleName)(indices=indices)
def main(): def main():
"""Parse options and execute commands.""" """Parse options and execute commands."""