File: empty-trash.gmp.py

package info (click to toggle)
gvm-tools 25.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,480 kB
  • sloc: python: 10,611; xml: 445; makefile: 27
file content (22 lines) | stat: -rwxr-xr-x 442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# SPDX-FileCopyrightText: 2014 Martin Boller
#
# SPDX-License-Identifier: GPL-3.0-or-later

from argparse import Namespace

from gvm.protocols.gmp import Gmp


def main(gmp: Gmp, args: Namespace) -> None:

    print("Emptying Trash...\n")

    try:
        status_text = gmp.empty_trashcan().xpath("@status_text")[0]
        print(status_text)
    except Exception as e:
        print(f"{e=}")


if __name__ == "__gmp__":
    main(gmp, args)