Support pycountry 1.12.

This commit is contained in:
Tobias Gruetzmacher 2015-06-24 01:04:28 +02:00
parent 0c6feec8cd
commit d78db39df9

6
dosage
View file

@ -155,7 +155,11 @@ def displayComicHelp(scraperobj):
try: try:
out.info(u"URL: " + scraperobj.url) out.info(u"URL: " + scraperobj.url)
if scraperobj.lang: if scraperobj.lang:
out.info(u"Language: " + pycountry.languages.get(alpha2 = scraperobj.lang).name) try:
lang = pycountry.languages.get(alpha2 = scraperobj.lang)
except KeyError:
lang = pycountry.languages.get(iso639_1_code = scraperobj.lang)
out.info(u"Language: " + lang.name)
if scraperobj.adult: if scraperobj.adult:
out.info(u"Adult comic, use option --adult to fetch.") out.info(u"Adult comic, use option --adult to fetch.")
disabled = scraperobj.getDisabledReasons() disabled = scraperobj.getDisabledReasons()