Commit 8a586df1 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Allow normalizer to access metadata via backend.

parent c74dc07b
Pipeline #71515 passed with stages
in 13 minutes and 32 seconds
......@@ -399,6 +399,11 @@ class Calc(Proc):
@task
def normalizing(self):
''' The *task* that encapsulates all normalizing related actions. '''
# allow normalizer to access and add data to the entry metadata
self._parser_backend.entry_archive.m_add_sub_section(
datamodel.EntryArchive.section_metadata, self._entry_metadata)
for normalizer in normalizers:
if normalizer.domain != parser_dict[self.parser].domain:
continue
......@@ -459,7 +464,9 @@ class Calc(Proc):
else:
entry_archive = datamodel.EntryArchive()
entry_archive.m_add_sub_section(datamodel.EntryArchive.section_metadata, self._entry_metadata)
if entry_archive.section_metadata is None:
entry_archive.m_add_sub_section(datamodel.EntryArchive.section_metadata, self._entry_metadata)
entry_archive.processing_logs = self._calc_proc_logs
try:
......
......@@ -124,6 +124,11 @@ class TestM2:
assert len(Run.m_def.all_sub_sections_by_section[System.m_def]) == 1
assert Run.m_def.all_sub_sections_by_section[System.m_def][0].sub_section == System.m_def
def test_unset_sub_section(self):
run = Run()
assert run.systems == []
assert run.parsing is None
def test_properties(self):
assert len(Run.m_def.all_properties) == 6
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment