From 8ce6b1eaaa1078f504955b7bd6087a7c6e9265ab Mon Sep 17 00:00:00 2001
From: Alexander Schlemmer <alexander@mail-schlemmer.de>
Date: Thu, 23 Mar 2023 18:41:09 +0100
Subject: [PATCH] REVIEW: Added deprecated function initialize_converters

---
 CHANGELOG.md             |  4 ++--
 src/caoscrawler/crawl.py | 12 ++++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f1241d40..0572dda7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,8 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - The ``prefix`` argument of `crawler_main` is deprecated. Use the new argument
   ``remove_prefix`` instead.
-- The functions ``load_definition`` and ``load_converters`` are deprecated. Please use
-  the functions ``load_definition`` and ``create_converter_registry`` from the scanner module
+- The functions ``load_definition``, ``initialize_converters`` and ``load_converters`` are deprecated. Please use
+  the functions ``load_definition``, ``initialize_converters`` and ``create_converter_registry`` from the scanner module
   instead.
 
 ### Removed ###
diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py
index da54104b..3dd10011 100644
--- a/src/caoscrawler/crawl.py
+++ b/src/caoscrawler/crawl.py
@@ -67,7 +67,10 @@ from .stores import GeneralStore, RecordStore
 from .structure_elements import StructureElement, Directory, NoneElement
 from .version import check_cfood_version
 
-from .scanner import scan_directory, load_definition, create_converter_registry
+from .scanner import (scan_directory,
+                      load_definition,
+                      create_converter_registry,
+                      initialize_converters)
 from .debug_tree import DebugTree
 
 logger = logging.getLogger(__name__)
@@ -229,9 +232,14 @@ class Crawler(object):
     def load_definition(self, crawler_definition_path: str):
         warnings.warn(DeprecationWarning(
                 "The function load_definition in the crawl module is deprecated. "
-            "Please use the load_definition from the scanner module."))
+            "Please use load_definition from the scanner module."))
         return load_definition(crawler_definition_path)
 
+    def initialize_converters(self, crawler_definition: dict, converter_registry: dict):
+        warnings.warn(DeprecationWarning(
+                "The function initialize_converters in the crawl module is deprecated. "
+            "Please use initialize_converters from the scanner module."))
+        return initialize_converters(crawler_definition, converter_registry)
             
     def generate_run_id(self):
         self.run_id = uuid.uuid1()
-- 
GitLab