Coverage for python/univention/config_registry/__init__.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.6.0, created at 2026-09-11 14:11 +0000

1# 

2# main configuration registry classes 

3# 

4# SPDX-FileCopyrightText: 2004-2026 Univention GmbH 

5# SPDX-License-Identifier: AGPL-3.0-only 

6 

7"""Univention Configuration Registry module.""" 

8 

9from lazy_object_proxy import Proxy 

10 

11from univention.config_registry.backend import ( # noqa: F401 

12 SCOPE, ConfigRegistry, Load, ReadOnlyConfigRegistry as _RCR, StrictModeException, 

13) 

14from univention.config_registry.filters import filter_keys_only, filter_shell, filter_sort # noqa: F401 

15from univention.config_registry.frontend import ( # noqa: F401 

16 REPLOG_FILE, UnknownKeyException, handler_commit, handler_dump, handler_filter, handler_get, handler_register, 

17 handler_search, handler_set, handler_unregister, handler_unset, handler_update, main, 

18) 

19# ruff: noqa: A004 

20from univention.config_registry.handler import ConfigHandlers as configHandlers, run_filter as filter # noqa: F401 

21from univention.config_registry.misc import ( # noqa: F401 

22 INVALID_KEY_CHARS as invalid_key_chars, key_shell_escape, validate_key, 

23) 

24from univention.debhelper import parseRfc822 # noqa: F401 

25 

26 

27ucr: _RCR = Proxy(lambda: _RCR().load(autoload=Load.ONCE)) 

28ucr_live: _RCR = Proxy(lambda: _RCR().load(autoload=Load.ALWAYS)) 

29 

30 

31def ucr_factory() -> ConfigRegistry: 

32 """ 

33 Factory method to return private loaded UCR instance. 

34 

35 :returns: A private UCR instance. 

36 """ 

37 return ConfigRegistry().load()