TuoniResultPart

class tuoni.TuoniResultPart(conf, c2)[source]

A class that provides data and functionality for a part of a command result.

type

The type of the result part.

Type:

str

name

The name of the result part.

Type:

str

value

The value associated with the result part.

Type:

str

filename

The filename of any file included in the result part.

Type:

str

uri

The URI for accessing the file in the result part.

Type:

str

get_as_file(filename)[source]

Retrieve the value of the result part as a file and save it to the specified location.

Parameters:

filename (str) – The path where the file should be saved.

get_as_json()[source]

Retrieve the value of the result part as JSON and convert it to a dictionary.

Returns:

The result part as a dictionary.

Return type:

dict

get_as_text()[source]

Retrieve the value of the result part as text.

Returns:

The value of the result part as a string.

Return type:

str