From 0cd10622b2298cdb4fe5746ea25e7c47a933682a Mon Sep 17 00:00:00 2001 From: arobbins Date: Wed, 26 Jun 2024 12:57:43 -0400 Subject: [PATCH] linting fix --- src/attack_flow/mermaid.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/attack_flow/mermaid.py b/src/attack_flow/mermaid.py index 19a257b9..b352fa10 100644 --- a/src/attack_flow/mermaid.py +++ b/src/attack_flow/mermaid.py @@ -34,7 +34,7 @@ def add_edge(self, src_id, target_id, text): def render(self): # Mermaid can't handle IDs with hyphens in them: convert_id = lambda id_: id_.replace("-", "_") - if self.direction: + if self.direction: lines = [f"graph {self.direction}"] else: lines = ["graph TB"] @@ -50,7 +50,7 @@ def render(self): if self.classes[node_class][0] == "circle": shape_start = "((" shape_end = "))" - elif self.classes[node_class][0] =="trap": + elif self.classes[node_class][0] == "trap": shape_start = "[/" shape_end = "\]" else: @@ -126,7 +126,8 @@ def convert_attack_flow(bundle): graph.add_node(o.id, "builtin", " - ".join(label_lines)) return graph.render() - + + def convert_attack_tree(bundle): """ @@ -147,7 +148,7 @@ def convert_attack_tree(bundle): objects = bundle.objects id_to_remove = [] ids = [] - + for i, o in enumerate(objects): if o.type == "attack-operator": id_to_remove.append( @@ -172,7 +173,6 @@ def convert_attack_tree(bundle): if j == operator["id"]: o.effect_refs[i] = operator["next_id"] - for o in bundle.objects: if o.type == "attack-action": if tid := o.get("technique_id", None):