Skip to content

Commit 615941d

Browse files
committed
fix: Update markdown and HTML generators to use public components
Fix method calls that were missed in the previous refactoring: - markdown_generator.py: Use contributor_tracker, statistics_collector, and hierarchy_builder - html_output.py: Use markdown_generator and hierarchy_builder This fixes test failures caused by calling removed facade methods.
1 parent 85a3bf1 commit 615941d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

mitreattack/diffStix/formatters/html_output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def write_detailed_html(html_file_detailed: str, diffStix):
129129
"""
130130
),
131131
header,
132-
markdown.markdown(diffStix.get_md_key()),
132+
markdown.markdown(diffStix.markdown_generator.get_md_key()),
133133
textwrap.dedent(
134134
"""\
135135
<table class=diff summary=Legends>
@@ -190,7 +190,7 @@ def write_detailed_html(html_file_detailed: str, diffStix):
190190
if stix_object["type"] == "x-mitre-data-component" or stix_object.get(
191191
"x_mitre_is_subtechnique"
192192
):
193-
parent_object = diffStix.get_parent_stix_object(
193+
parent_object = diffStix.hierarchy_builder.get_parent_stix_object(
194194
stix_object=stix_object, datastore_version=datastore_version, domain=domain
195195
)
196196
if parent_object:

mitreattack/diffStix/formatters/markdown_generator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ def generate(self) -> str:
4040

4141
# Add contributors if requested
4242
if self.diff_stix.include_contributors:
43-
content += self.diff_stix.get_contributor_section()
43+
content += self.diff_stix.contributor_tracker.get_contributor_section()
4444
content += "\n"
4545

4646
# Add statistics section for the new version
4747
logger.info("Generating statistics section")
48-
stats_section = self.diff_stix.get_statistics_section(datastore_version="new")
48+
stats_section = self.diff_stix.statistics_collector.generate_statistics_section(datastore_version="new")
4949
content += stats_section
5050

5151
if self.diff_stix.show_key:
@@ -157,7 +157,7 @@ def placard(self, stix_object: dict, section: str, domain: str) -> str:
157157
revoker = stix_object["revoked_by"]
158158

159159
if revoker.get("x_mitre_is_subtechnique"):
160-
parent_object = self.diff_stix.get_parent_stix_object(
160+
parent_object = self.diff_stix.hierarchy_builder.get_parent_stix_object(
161161
stix_object=revoker, datastore_version=datastore_version, domain=domain
162162
)
163163
parent_name = parent_object.get("name", "ERROR NO PARENT")
@@ -168,7 +168,7 @@ def placard(self, stix_object: dict, section: str, domain: str) -> str:
168168
)
169169

170170
elif revoker["type"] == "x-mitre-data-component":
171-
parent_object = self.diff_stix.get_parent_stix_object(
171+
parent_object = self.diff_stix.hierarchy_builder.get_parent_stix_object(
172172
stix_object=revoker, datastore_version=datastore_version, domain=domain
173173
)
174174
if parent_object:
@@ -189,7 +189,7 @@ def placard(self, stix_object: dict, section: str, domain: str) -> str:
189189

190190
else:
191191
if stix_object["type"] == "x-mitre-data-component":
192-
parent_object = self.diff_stix.get_parent_stix_object(
192+
parent_object = self.diff_stix.hierarchy_builder.get_parent_stix_object(
193193
stix_object=stix_object, datastore_version=datastore_version, domain=domain
194194
)
195195
if parent_object:

0 commit comments

Comments
 (0)