Skip to content
Snippets Groups Projects
Commit 8ce6b1ea authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

REVIEW: Added deprecated function initialize_converters

parent ecbc8995
No related branches found
No related tags found
2 merge requests!108Release 0.5.0,!104Create a new scanner module and move functions from crawl module there
Pipeline #34883 passed with warnings
......@@ -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 ###
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment