spdx_tools.spdx3.writer.console.relationship_writer

 1# SPDX-FileCopyrightText: 2023 spdx contributors
 2#
 3# SPDX-License-Identifier: Apache-2.0
 4from beartype.typing import TextIO
 5
 6from spdx_tools.spdx3.model import Relationship
 7from spdx_tools.spdx3.writer.console.console import write_value
 8from spdx_tools.spdx3.writer.console.element_writer import write_element_properties
 9
10
11def write_relationship(relationship: Relationship, text_output: TextIO, heading: bool = True):
12    if heading:
13        text_output.write("## Relationship\n")
14    write_element_properties(relationship, text_output)
15    for property_name in relationship.__annotations__.keys():
16        write_value(property_name, getattr(relationship, property_name), text_output)
def write_relationship( relationship: spdx_tools.spdx3.model.relationship.Relationship, text_output: <class 'TextIO'>, heading: bool = True):
12def write_relationship(relationship: Relationship, text_output: TextIO, heading: bool = True):
13    if heading:
14        text_output.write("## Relationship\n")
15    write_element_properties(relationship, text_output)
16    for property_name in relationship.__annotations__.keys():
17        write_value(property_name, getattr(relationship, property_name), text_output)