PATH:
usr
/
lib64
/
python3.9
/
site-packages
/
setools
/
diff
# Copyright 2015, Tresys Technology, LLC # # SPDX-License-Identifier: LGPL-2.1-only # from typing import MutableMapping from weakref import WeakKeyDictionary class DiffResultDescriptor: """Descriptor for managing diff results.""" # @properties could be used instead, but there are so # many result attributes, this will keep the code cleaner. def __init__(self, diff_function: str) -> None: self.diff_function = diff_function # use weak references so instances can be # garbage collected, rather than unnecessarily # kept around due to this descriptor. self.instances: MutableMapping = WeakKeyDictionary() def __get__(self, obj, objtype=None): if obj is None: return self if self.instances.setdefault(obj, None) is None: diff = getattr(obj, self.diff_function) diff() return self.instances[obj] def __set__(self, obj, value): self.instances[obj] = value def __delete__(self, obj): self.instances[obj] = None
[-] genfscon.py
[edit]
[-] mls.py
[edit]
[-] polcap.py
[edit]
[-] netifcon.py
[edit]
[-] terules.py
[edit]
[-] users.py
[edit]
[-] types.py
[edit]
[-] nodecon.py
[edit]
[-] constraints.py
[edit]
[-] bounds.py
[edit]
[-] __init__.py
[edit]
[-] bool.py
[edit]
[-] mlsrules.py
[edit]
[-] initsid.py
[edit]
[-] roles.py
[edit]
[-] typing.py
[edit]
[-] context.py
[edit]
[-] default.py
[edit]
[-] fsuse.py
[edit]
[-] conditional.py
[edit]
[+]
..
[-] descriptors.py
[edit]
[-] ibpkeycon.py
[edit]
[-] ibendportcon.py
[edit]
[-] commons.py
[edit]
[-] typeattr.py
[edit]
[-] portcon.py
[edit]
[-] properties.py
[edit]
[+]
__pycache__
[-] rbacrules.py
[edit]
[-] objclass.py
[edit]
[-] difference.py
[edit]