From 90685d9b0cbde0607f15b5dd1f14f458d417d5bb Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 26 Nov 2017 19:26:44 +0100 Subject: [PATCH] Only support modern versions of PyCountry. --- dosagelib/languages.py | 2 +- dosagelib/scraper.py | 5 ++--- scripts/mklanguages.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dosagelib/languages.py b/dosagelib/languages.py index a31d1b459..d31e1b6e9 100644 --- a/dosagelib/languages.py +++ b/dosagelib/languages.py @@ -5,7 +5,7 @@ from __future__ import absolute_import, division, print_function Languages = { 'de': 'German', 'en': 'English', - 'es': 'Spanish; Castilian', + 'es': 'Spanish', 'fi': 'Finnish', 'fr': 'French', 'it': 'Italian', diff --git a/dosagelib/scraper.py b/dosagelib/scraper.py index a14fdd9f1..025d20370 100644 --- a/dosagelib/scraper.py +++ b/dosagelib/scraper.py @@ -343,11 +343,10 @@ class Scraper(object): lang = languages.Languages[self.lang] else: try: - lang = pycountry.languages.get(alpha2=self.lang).name + lang = pycountry.languages.get(alpha_2=self.lang).name except KeyError: try: - lang = pycountry.languages.get( - iso639_1_code=self.lang).name + lang = pycountry.languages.get(alpha2=self.lang).name except KeyError: pass return lang diff --git a/scripts/mklanguages.py b/scripts/mklanguages.py index 1e818ef0c..258dadcd3 100755 --- a/scripts/mklanguages.py +++ b/scripts/mklanguages.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam