File: registry.py

package info (click to toggle)
ospd-openvas 22.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,664 kB
  • sloc: python: 14,268; xml: 1,913; makefile: 45; sh: 29
file content (23 lines) | stat: -rw-r--r-- 508 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
23
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2014-2023 Greenbone AG
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from typing import List

__COMMANDS = []


def register_command(command: object) -> None:
    """Register a command class"""
    __COMMANDS.append(command)


def remove_command(command: object) -> None:
    """Unregister a command class"""
    __COMMANDS.remove(command)


def get_commands() -> List[object]:
    """Return the list of registered command classes"""
    return __COMMANDS