From 99e67b079f8d3267e9bbd53bbdb9cf729be61d87 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 31 Jul 2020 15:23:17 -0700 Subject: directories: all extra metadata in top-level dict Had been using slug-specific sub-objects, but this was too confusing. --- chocula/directories/norwegian.py | 4 ++-- chocula/directories/sherpa_romeo.py | 2 +- chocula/directories/szczepanski.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'chocula/directories') diff --git a/chocula/directories/norwegian.py b/chocula/directories/norwegian.py index 8bfa19a..74167a0 100644 --- a/chocula/directories/norwegian.py +++ b/chocula/directories/norwegian.py @@ -67,9 +67,9 @@ class NorwegianLoader(DirectoryLoader): langs=[lang for lang in [parse_lang(row["Language"])] if lang], ) - info.extra["norwegian"] = dict(as_of=self.config.norwegian.date) + info.extra["as_of"] = self.config.norwegian.date if row["Level 2019"]: - info.extra["norwegian"]["level"] = int(row["Level 2019"]) + info.extra["level"] = int(row["Level 2019"]) if row["Original title"] != row["International title"]: info.original_name = clean_str(row["Original title"]) diff --git a/chocula/directories/sherpa_romeo.py b/chocula/directories/sherpa_romeo.py index a8ba1b0..5618302 100644 --- a/chocula/directories/sherpa_romeo.py +++ b/chocula/directories/sherpa_romeo.py @@ -58,6 +58,6 @@ class SherpaRomeoLoader(DirectoryLoader): ) if row["RoMEO colour"]: - info.extra["sherpa_romeo"] = dict(color=row["RoMEO colour"]) + info.extra["color"] = row["RoMEO colour"] return info diff --git a/chocula/directories/szczepanski.py b/chocula/directories/szczepanski.py index 3586acb..88e35a8 100644 --- a/chocula/directories/szczepanski.py +++ b/chocula/directories/szczepanski.py @@ -33,12 +33,12 @@ class SzczepanskiLoader(DirectoryLoader): publisher=clean_str(row.get("ed")), ) - info.extra["szczepanski"] = dict(as_of=self.config.szczepanski.date) + info.extra["as_of"] = self.config.szczepanski.date if row.get("extra"): - info.extra["szczepanski"]["notes"] = row.get("extra") + info.extra["notes"] = row.get("extra") for k in ("other_titles", "year_spans", "ed"): if row.get(k): - info.extra["szczepanski"][k] = row[k] + info.extra[k] = row[k] url = HomepageUrl.from_url(row.get("url")) if url: -- cgit v1.2.3