From d000b6266b6f638edfd65f2ac9797632e2c61cc9 Mon Sep 17 00:00:00 2001 From: Brian Lindner <8153326+BrianLindner@users.noreply.github.com> Date: Sun, 23 Oct 2022 17:02:14 -0400 Subject: [PATCH] logging --- schedule_preroll.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/schedule_preroll.py b/schedule_preroll.py index cc40380..996e3ca 100644 --- a/schedule_preroll.py +++ b/schedule_preroll.py @@ -297,25 +297,27 @@ def schedulefile_contents(schedule_filename: Optional[str]) -> dict[str, any]: if schedule_filename not in ("", None): if os.path.exists(str(schedule_filename)): filename = schedule_filename + + logger.debug('using specified schedule file "%s"', filename) else: msg = f'Pre-roll Schedule file "{schedule_filename}" not found' logger.error(msg) raise FileNotFoundError(msg) else: for f in default_files: - if os.path.exists(f): - filename = f + default_file = os.path.join(script_dir, f) + if os.path.exists(default_file): + filename = default_file + logger.debug('using default schedule file "%s"', filename) break - logger.debug('using schedule file "%s"', filename) - # if we still cant find a schedule file, we abort if not filename: filestr = '" / "'.join(default_files) logger.error('Missing schedule file: "%s"', filestr) raise FileNotFoundError(filestr) - schema_filename = script_dir + "/" + "util/schedulefile_schema.json" + schema_filename = os.path.join(script_dir, "util/schedulefile_schema.json") logger.debug('using schema validation file "%s"', schema_filename)