From cace1271ae71a01f673a9a6824a8f27a8e41f696 Mon Sep 17 00:00:00 2001 From: Labrys of Knossos Date: Wed, 14 Dec 2022 03:31:45 -0500 Subject: [PATCH] Raise error if processing without a loaded config --- core/auto_process/books.py | 2 ++ core/auto_process/comics.py | 2 ++ core/auto_process/games.py | 2 ++ core/auto_process/movies.py | 2 ++ core/auto_process/music.py | 2 ++ core/auto_process/tv.py | 2 ++ 6 files changed, 12 insertions(+) diff --git a/core/auto_process/books.py b/core/auto_process/books.py index 3fe18aff..0daa49b3 100644 --- a/core/auto_process/books.py +++ b/core/auto_process/books.py @@ -44,6 +44,8 @@ def process( failure_link: str = '', ) -> ProcessResult: # Get configuration + if core.CFG is None: + raise RuntimeError('Configuration not loaded.') cfg = core.CFG[section][input_category] # Base URL diff --git a/core/auto_process/comics.py b/core/auto_process/comics.py index 3105701d..e8cb4e6b 100644 --- a/core/auto_process/comics.py +++ b/core/auto_process/comics.py @@ -44,6 +44,8 @@ def process( failure_link: str = '', ) -> ProcessResult: # Get configuration + if core.CFG is None: + raise RuntimeError('Configuration not loaded.') cfg = core.CFG[section][input_category] # Base URL diff --git a/core/auto_process/games.py b/core/auto_process/games.py index ab34b531..0a197358 100644 --- a/core/auto_process/games.py +++ b/core/auto_process/games.py @@ -44,6 +44,8 @@ def process( failure_link: str = '', ) -> ProcessResult: # Get configuration + if core.CFG is None: + raise RuntimeError('Configuration not loaded.') cfg = core.CFG[section][input_category] # Base URL diff --git a/core/auto_process/movies.py b/core/auto_process/movies.py index f1f79c32..0acece69 100644 --- a/core/auto_process/movies.py +++ b/core/auto_process/movies.py @@ -44,6 +44,8 @@ def process( failure_link: str = '', ) -> ProcessResult: # Get configuration + if core.CFG is None: + raise RuntimeError('Configuration not loaded.') cfg = core.CFG[section][input_category] # Base URL diff --git a/core/auto_process/music.py b/core/auto_process/music.py index 4e8ecf1f..bce5f0bc 100644 --- a/core/auto_process/music.py +++ b/core/auto_process/music.py @@ -44,6 +44,8 @@ def process( failure_link: str = '', ) -> ProcessResult: # Get configuration + if core.CFG is None: + raise RuntimeError('Configuration not loaded.') cfg = core.CFG[section][input_category] # Base URL diff --git a/core/auto_process/tv.py b/core/auto_process/tv.py index 6f7f4980..d2a88e6d 100644 --- a/core/auto_process/tv.py +++ b/core/auto_process/tv.py @@ -44,6 +44,8 @@ def process( failure_link: str = '', ) -> ProcessResult: # Get configuration + if core.CFG is None: + raise RuntimeError('Configuration not loaded.') cfg = core.CFG[section][input_category] # Base URL