spdx_tools.spdx3.writer.console.tool_writer

 1# SPDX-License-Identifier: Apache-2.0
 2#  Copyright (c) 2023 spdx contributors
 3#  Licensed under the Apache License, Version 2.0 (the "License");
 4#  you may not use this file except in compliance with the License.
 5#  You may obtain a copy of the License at
 6#      http://www.apache.org/licenses/LICENSE-2.0
 7#  Unless required by applicable law or agreed to in writing, software
 8#  distributed under the License is distributed on an "AS IS" BASIS,
 9#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10#  See the License for the specific language governing permissions and
11#  limitations under the License.
12from beartype.typing import TextIO
13
14from spdx_tools.spdx3.model import Tool
15from spdx_tools.spdx3.writer.console.element_writer import write_element_properties
16
17
18def write_tool(tool: Tool, text_output: TextIO, heading: bool = True):
19    if heading:
20        text_output.write("## Tool\n")
21    write_element_properties(tool, text_output)
def write_tool( tool: spdx_tools.spdx3.model.tool.Tool, text_output: <class 'TextIO'>, heading: bool = True):
19def write_tool(tool: Tool, text_output: TextIO, heading: bool = True):
20    if heading:
21        text_output.write("## Tool\n")
22    write_element_properties(tool, text_output)