diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-09-03 11:12:56 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-09-06 11:46:43 -0400 |
| commit | 5c82c6036e04936e253d2031f73f8218bbed06aa (patch) | |
| tree | 7ef969a79c88e4277d495fbae1cef5131d43f6ec /python/flowgraph.py | |
| parent | d28dc76f738c1b3c6469213c2582ca7680b8fefe (diff) | |
Commonize _to_core_struct/_from_core_struct
Improve implementation of immutable_copy/mutable_copy
Diffstat (limited to 'python/flowgraph.py')
| -rw-r--r-- | python/flowgraph.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/flowgraph.py b/python/flowgraph.py index 2fe4545a..65287f19 100644 --- a/python/flowgraph.py +++ b/python/flowgraph.py @@ -64,7 +64,7 @@ class EdgeStyle: self.width = width if width is not None else 0 self.color = theme_color if theme_color is not None else ThemeColor.AddressColor - def _get_core_struct(self): + def _to_core_struct(self) -> core.BNEdgeStyle: result = core.BNEdgeStyle() result.style = self.style result.width = self.width @@ -245,7 +245,7 @@ class FlowGraphNode: raise ValueError("Specified color is not one of HighlightStandardColor, highlight.HighlightColor") if isinstance(color, HighlightStandardColor): color = highlight.HighlightColor(color) - line_buf[i].highlight = color._get_core_struct() + line_buf[i].highlight = color._to_core_struct() line_buf[i].count = len(line.tokens) line_buf[i].tokens = function.InstructionTextToken._get_core_struct(line.tokens) core.BNSetFlowGraphNodeLines(self.handle, line_buf, len(lines)) @@ -307,7 +307,7 @@ class FlowGraphNode: raise ValueError("Specified color is not one of HighlightStandardColor, highlight.HighlightColor") if isinstance(color, HighlightStandardColor): color = highlight.HighlightColor(color) - core.BNSetFlowGraphNodeHighlight(self.handle, color._get_core_struct()) + core.BNSetFlowGraphNodeHighlight(self.handle, color._to_core_struct()) def add_outgoing_edge(self, edge_type, target, style=None): """ @@ -325,7 +325,7 @@ class FlowGraphNode: elif not isinstance(style, EdgeStyle): raise AttributeError("style must be of type EdgeStyle") - core.BNAddFlowGraphNodeOutgoingEdge(self.handle, edge_type, target.handle, style._get_core_struct()) + core.BNAddFlowGraphNodeOutgoingEdge(self.handle, edge_type, target.handle, style._to_core_struct()) def is_valid_for_graph(self, graph): return core.BNIsNodeValidForFlowGraph(graph.handle, self.handle) |
