Skip to content

Cleanup

sereto.cleanup

render_finding_group_cleanup(finding_group, target, report, settings)

Renders the cleanup for a finding group in the specified report.

Parameters:

Name Type Description Default
finding_group FindingGroup

The finding group to render the cleanup for.

required
target Target

The target associated with the finding group.

required
report Report

The report to render the cleanup in.

required
settings Settings

The settings for rendering the report.

required

Returns:

Type Description
None

None

Source code in sereto/cleanup.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
def render_finding_group_cleanup(
    finding_group: FindingGroup, target: Target, report: Report, settings: Settings
) -> None:
    """Renders the cleanup for a finding group in the specified report.

    Args:
        finding_group: The finding group to render the cleanup for.
        target: The target associated with the finding group.
        report: The report to render the cleanup in.
        settings: The settings for rendering the report.

    Returns:
        None
    """
    report_path = Report.get_path(dir_subtree=settings.reports_path)
    finding_group_tex_path = report_path / f"{target.uname}_{finding_group.uname}.tex"
    finding_group_tex_path.unlink()

render_report_cleanup(report, settings, version)

Removes the report.tex file associated with the given report.

Parameters:

Name Type Description Default
report Report

The report object.

required
settings Settings

The settings object.

required
version ReportVersion

The report version object.

required

Returns:

Type Description
None

None

Source code in sereto/cleanup.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def render_report_cleanup(report: Report, settings: Settings, version: ReportVersion) -> None:
    """Removes the report.tex file associated with the given report.

    Args:
        report: The report object.
        settings: The settings object.
        version: The report version object.

    Returns:
        None
    """
    report_path = Report.get_path(dir_subtree=settings.reports_path)
    report_tex_path = report_path / f"report{version.path_suffix}.tex"
    report_tex_path.unlink()

render_sow_cleanup(report, settings, version)

Removes the 'sow.tex' file associated with the given report.

Parameters:

Name Type Description Default
report Report

The report object.

required
settings Settings

The settings object.

required
version ReportVersion

The report version object.

required

Returns:

Type Description
None

None

Source code in sereto/cleanup.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
def render_sow_cleanup(report: Report, settings: Settings, version: ReportVersion) -> None:
    """Removes the 'sow.tex' file associated with the given report.

    Args:
        report: The report object.
        settings: The settings object.
        version: The report version object.

    Returns:
        None
    """
    report_path = Report.get_path(dir_subtree=settings.reports_path)
    sow_tex_path = report_path / f"sow{version.path_suffix}.tex"
    sow_tex_path.unlink()

render_target_cleanup(target, report, settings)

Cleans up the rendered target by deleting the corresponding .tex file.

Parameters:

Name Type Description Default
target Target

The target to be cleaned up.

required
report Report

The report containing the target.

required
settings Settings

The settings for the cleanup process.

required

Returns:

Type Description
None

None

Source code in sereto/cleanup.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
def render_target_cleanup(target: Target, report: Report, settings: Settings) -> None:
    """Cleans up the rendered target by deleting the corresponding .tex file.

    Args:
        target: The target to be cleaned up.
        report: The report containing the target.
        settings: The settings for the cleanup process.

    Returns:
        None
    """
    report_path = Report.get_path(dir_subtree=settings.reports_path)
    target_tex_path = report_path / f"{target.uname}.tex"
    target_tex_path.unlink()