PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/salt/defaults/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/salt/defaults/__init__.py

"""
Default values, to be imported elsewhere in Salt code

Do NOT, import any salt modules (salt.utils, salt.config, etc.) into this file,
as this may result in circular imports.
"""


class _Constant:
    """
    This class implements a way to create constants in python.

    NOTE:

      - This is not really a constant, ie, the `is` check will not work, you'll
        have to use `==`.
      - This class SHALL NOT be considered public API and might change or even
        go away at any given time.
    """

    __slots__ = ("name", "value")

    def __init__(self, name, value=None):
        self.name = name
        self.value = value

    def __hash__(self):
        return hash((self.name, self.value))

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return False
        if self.name != other.name:
            return False
        return self.value == other.value

    def __get_state__(self):
        return {
            "name": self.name,
            "value": self.value,
        }

    def __set_state__(self, state):
        return self.__class__(state["name"], state["value"])

    def __repr__(self):
        if self.value:
            return f"<Constant.{self.name} value={self.value}>"
        return f"<Constant.{self.name}>"


# Default delimiter for multi-level traversal in targeting
DEFAULT_TARGET_DELIM = ":"


"""
Used in functions to define that a keyword default is not set.

It's used to differentiate from `None`, `True`, `False` which, in some
cases are proper defaults and are also proper values to pass.
"""
NOT_SET = _Constant("NOT_SET")