From 1202cc7c7e1ce78986a8db9dc4e13eb8a0b9bce9 Mon Sep 17 00:00:00 2001 From: Johannes Neumeier Date: Mon, 7 Oct 2024 16:14:23 +0300 Subject: [PATCH] Hotfix hyperglot-data attribute error --- CHANGELOG.md | 3 +++ lib/hyperglot/__init__.py | 2 +- lib/hyperglot/cli.py | 2 +- lib/hyperglot/languages.py | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1731a31..ffff8c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # A changelog for the lib/hyperglot language database and CLI tool (dd.mm.yyyy) +## 0.7.1 (07.10.2024) +- FIX: Fixed `hyperglot-data` error + ## 0.7.0 (07.10.2024) - DATA: All language yaml documents now have their `contributors` listed, some have `reviewers` listed - DATA: **Massive* improvement of language `sources` with proper source citations where possible diff --git a/lib/hyperglot/__init__.py b/lib/hyperglot/__init__.py index f3f74e2a..8ad69e74 100644 --- a/lib/hyperglot/__init__.py +++ b/lib/hyperglot/__init__.py @@ -6,7 +6,7 @@ from enum import Enum from typing import List -__version__ = "0.7.0" +__version__ = "0.7.1" DB = path.abspath(path.join(path.dirname(__file__), "data")) DB_EXTRA = path.abspath(path.join(path.dirname(__file__), "extra_data")) diff --git a/lib/hyperglot/cli.py b/lib/hyperglot/cli.py index d5e8ab94..de855fe5 100644 --- a/lib/hyperglot/cli.py +++ b/lib/hyperglot/cli.py @@ -458,7 +458,7 @@ def export(output): @click.command() @click.argument("search") -def data(search): +def data(search=""): """ Pass in a 3-letter iso code or language name (search term) to show Hyperglot data for it diff --git a/lib/hyperglot/languages.py b/lib/hyperglot/languages.py index 13646a45..133c15be 100644 --- a/lib/hyperglot/languages.py +++ b/lib/hyperglot/languages.py @@ -36,7 +36,7 @@ def find_language(search): autonyms = [] if not aut else [aut.lower()] if "orthographies" in lang: for o in lang["orthographies"]: - if "autonym" in o: + if "autonym" in o and o["autonym"] is not None: autonyms.append(o["autonym"].lower()) if search == name or search in autonyms: