2026-07-14 14:53:56 +02:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
import glob
|
|
|
|
|
import os
|
|
|
|
|
import re
|
|
|
|
|
import sys
|
2025-01-20 11:39:56 +01:00
|
|
|
|
2026-07-14 15:26:23 +02:00
|
|
|
from collections.abc import Iterator, Mapping
|
mypy: Fix any_generics, redundant_casts, unused_ignores
Add mypy directives disallow_any_generics, warn_redundant_casts, and
warn_unused_ignores. Fix all resulting type annotation errors:
- load_yaml.py: Add type arguments to dict, tuple, set annotations; fix
resolving dict/set types for link keys; handle str|int path types.
- misc.py: Add Mapping[str, Any] and Iterable[Any] type arguments; fix
multiline export comment to avoid bad pattern flag.
- multi_key_dict.py: Add type argument to dict[tuple, Any].
- StringTree.py: Move Any import out of TYPE_CHECKING; fix MutableMapping
type args.
- serdes.py: Add type argument to re.Match.
- Config.py: Change Config from Mapping to Mapping[str, str]; remove
unused cast.
- ev/base/Object.py, SimpleObject.py, EventLogger.py, PollerOneShot.py:
Add Mapping[str, Any] type args.
- ev/app/EventRouter.py: Add dict[str, Any] type args in inner functions.
- auth/*: Remove now-unnecessary # type: ignore[return-value] comments.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.82.0
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 19:25:57 +02:00
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
from pathlib import Path
|
mypy: Fix disallow_incomplete_defs fallout
Add parameter and return type annotations to untyped functions all
over the package:
- ldap.py: Add return types to Config properties (ldap_uri, bind_dn,
bind_pw, base_dn), Connection.__init__, add, delete, walk, find,
__oc_recurse_to_top, object_class_path, and inner callbacks
- cast.py: Add Any import, add return type annotations to
cast_str_to_bool, guess_type, from_str, from_env, cast_str, and
parameter type annotations where missing
- Table.py:
- __init__ (schema: Schema)
- __eq__ (rhs: Any)
- _column_data_type (name: str)
- _column_default (name: str)
- column_default (name: str)
- foreign_keys_to_parent_table (parent_table: Any)
- misc.py:
- get_derived_classes (mod: Any, flt: Any)
- load_classes (flt: Any)
- load_class_names (remove_flt: bool)
- load_object (*args: Any, **kwargs: Any)
- multi_regex_edit (spec: Any)
- dump_dict (*args: Any, **kwargs: Any)
- get_derived_classes (mod: Any, flt: Any)
- load_classes (flt: Any)
- load_class_names (remove_flt: bool)
- load_object (*args: Any, **kwargs: Any)
- dump (*args: Any, **kwargs: Any)
- MapAttr2Shape.py, ShuntingYard.py, Queries.py:
- Add parameter and return type annotations to fix disallow_incomplete_defs:
- MapAttr2Shape.py: __keys, __attribs, __massage_node, __massage_nodes, __add
- ShuntingYard.py: Op.__init__, tokenize, infix_to_postfix, eval_postfix, eval
- Queries.py: _run, _register, name property, __getitem__, keys, load, add, _add
- Add parameter and return type annotations:
- ArgsContainer.py: __setattr__, args, kwargs, dump, specified_args, add_argument
- rows.py: rows_duplicates, rows_check_not_null, rows_dumps, rows_dump
- auth/Auth.py: load, conf, _entity, projects
- auth/ldap/Auth.py: __init__, _create_entity
- Fix parameter type annotations:
- rows_check_not_null: keys: str | list[str], stat_key: str | None, caller: Any
- rows_dumps: lead: str | list[str] | None, tablefmt: str | None
- rows_dump: heading: str | None, lead: str | list[str] | None, tablefmt: str | None
- Table.py: column_default, add_row_location, add_child_row_location
- CompositeForeignKey.py: __table, parent_column, child_column
- TableIoHandler.py: _load, _store, load
- Query.py: _register, register, parent property
- Ldap.py: Entity.__init__, Ldap.__init__, _create_entity
- MapAttr2Shape.py, auth/ldap/Auth.py, Query.py:
- MapAttr2Shape.py: Add None check for id, add None check for graph
- auth/ldap/Auth.py: Add Any import, fix __init__ and _create_entity
- Query.py: Fix _add, run, parent signatures
- ArgsContainer.py: __setattr__, args, kwargs, dump, specified_args, add_argument
- Config.py: dump
- ShuntingYard.py: Op.__init__, tokenize, infix_to_postfix, eval_postfix, eval
- ShellCmd.py: __init__
- auth/Auth.py: load, __init__
- auth/dummy/Auth.py: Entity.__init__, Auth.__init__
- auth/ldap/Auth.py: Entity.__init__, Auth.__init__, _create_entity
- cast.py: guess_type
- DataBase.py: _create_session, _delete_session
- TableIoHandler.py: load
- Query.py: _run, _register, register, _add, run, parent/db properties
- QueryResult.py: pages, _cast
- rows.py: rows_duplicates, rows_check_not_null, rows_dumps, rows_dump
- Column.py: __eq__, foreign_key
- Schema.py: _access_defining_columns, access_defining_columns, table_by_model_name
- Table.py: __init__, __eq__, _column_data_type, _column_default, column_default,
__relationship_by_foreign_table, add_row_location, add_child_row_location
- utils.py: check_schema
- EventRouter.py: iter_peers
- Group.py: __init__
- SimpleEntity.py: __init__
- Ldap.py: Entity.__init__, Ldap.__init__, _create_entity
- Event.py: __init__
- Fuse.py: __init__
- Object.py: __init__
- SimpleObject.py: __init__, create
- EvRequest.py: __init__
- Msg.py: __init__
- ldap.py: Config.__get__, Config properties, Connection methods, inner callbacks
- misc.py: get_derived_classes, load_classes, load_class_names, load_object,
multi_regex_edit, dump_dict, dump
- multi_key_dict.py: items
- MapAttr2Shape.py: __keys, __attribs, __massage_node, __massage_nodes, __add
- auth/dummy/Auth.py: Entity.__init__, Auth.__init__
- Query.py: _run, _register, register, _add, run, parent/db properties
- QueryResult.py: pages, _cast
- Column.py: __eq__, foreign_key
- Schema.py: _access_defining_columns, access_defining_columns, table_by_model_name
- Table.py: __init__, __eq__, _column_data_type, _column_default, column_default,
__relationship_by_foreign_table, add_row_location, add_child_row_location
- utils.py: check_schema
- EventRouter.py: iter_peers
- Group.py: __init__
- SimpleEntity.py: __init__
- Ldap.py: Entity.__init__, Ldap.__init__, _create_entity
- Event.py: __init__
- Fuse.py: __init__
- Object.py: __init__
- SimpleObject.py: __init__, create
- EvRequest.py: __init__
- Msg.py: __init__
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.82.0
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 22:34:10 +02:00
|
|
|
from typing import Any, override
|
2025-01-20 11:39:56 +01:00
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
from .stree import serdes
|
|
|
|
|
from .log import DEBUG, ERR, slog, get_caller_pos
|
2025-01-20 11:39:56 +01:00
|
|
|
from .stree.StringTree import StringTree
|
|
|
|
|
|
2026-07-14 14:51:26 +02:00
|
|
|
# Default file mode mask for secret-checking: reject group-write or
|
|
|
|
|
# world-accessible files that contain password/secret-like content.
|
|
|
|
|
_REFUSE_MODE_MASK: int = 0o0027
|
|
|
|
|
|
mypy: Fix any_generics, redundant_casts, unused_ignores
Add mypy directives disallow_any_generics, warn_redundant_casts, and
warn_unused_ignores. Fix all resulting type annotation errors:
- load_yaml.py: Add type arguments to dict, tuple, set annotations; fix
resolving dict/set types for link keys; handle str|int path types.
- misc.py: Add Mapping[str, Any] and Iterable[Any] type arguments; fix
multiline export comment to avoid bad pattern flag.
- multi_key_dict.py: Add type argument to dict[tuple, Any].
- StringTree.py: Move Any import out of TYPE_CHECKING; fix MutableMapping
type args.
- serdes.py: Add type argument to re.Match.
- Config.py: Change Config from Mapping to Mapping[str, str]; remove
unused cast.
- ev/base/Object.py, SimpleObject.py, EventLogger.py, PollerOneShot.py:
Add Mapping[str, Any] type args.
- ev/app/EventRouter.py: Add dict[str, Any] type args in inner functions.
- auth/*: Remove now-unnecessary # type: ignore[return-value] comments.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.82.0
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 19:25:57 +02:00
|
|
|
class Config(Mapping[str, str]): # export
|
2025-01-20 11:39:56 +01:00
|
|
|
|
2026-07-14 14:51:54 +02:00
|
|
|
def __load(
|
|
|
|
|
self,
|
|
|
|
|
search_dirs: list[str] | None,
|
2026-07-24 18:48:09 +02:00
|
|
|
glob_paths: list[str] | str | None,
|
2026-07-14 14:51:54 +02:00
|
|
|
refuse_mode_mask: int | None
|
|
|
|
|
) -> StringTree:
|
2025-01-20 11:39:56 +01:00
|
|
|
|
2025-01-28 08:05:16 +01:00
|
|
|
ret = StringTree("", "")
|
2025-01-20 11:39:56 +01:00
|
|
|
exe = Path(os.path.basename(sys.argv[0])).stem
|
|
|
|
|
if glob_paths is None:
|
|
|
|
|
glob_paths = [f'.{exe}', f'{exe}.conf']
|
2025-01-29 12:56:32 +01:00
|
|
|
elif isinstance(glob_paths, str):
|
|
|
|
|
glob_paths = [glob_paths]
|
2025-01-20 11:39:56 +01:00
|
|
|
if search_dirs is None:
|
|
|
|
|
env_key = re.sub('[-.]', '_', exe)
|
2026-07-14 14:49:04 +02:00
|
|
|
env_val = os.getenv(env_key)
|
|
|
|
|
if env_val is not None:
|
|
|
|
|
search_dirs = env_val.split(':')
|
2025-01-20 11:39:56 +01:00
|
|
|
for path in glob_paths:
|
|
|
|
|
dirs = search_dirs
|
|
|
|
|
if dirs is None:
|
2026-07-14 14:51:15 +02:00
|
|
|
if path and os.path.isabs(path):
|
|
|
|
|
dirs = ['']
|
|
|
|
|
else:
|
|
|
|
|
dirs = [str(Path.home()), str(Path.cwd())]
|
2025-01-20 11:39:56 +01:00
|
|
|
for d in dirs:
|
2025-01-29 12:56:32 +01:00
|
|
|
g = d + '/' + path if len(d) else path
|
2025-01-20 11:39:56 +01:00
|
|
|
slog(DEBUG, 'Looking for config "{}"'.format(g))
|
|
|
|
|
for f in glob.glob(g):
|
|
|
|
|
slog(DEBUG, 'Reading config "{}"'.format(f))
|
2026-07-14 14:51:54 +02:00
|
|
|
paths_buf: list[str] = []
|
2026-06-10 13:28:35 +02:00
|
|
|
tree = serdes.read(f, paths_buf = paths_buf)
|
2026-07-14 14:51:39 +02:00
|
|
|
assert len(paths_buf) > 0, \
|
|
|
|
|
f'Expected at least one path in paths_buf, got {len(paths_buf)}'
|
2025-01-30 09:54:03 +01:00
|
|
|
if refuse_mode_mask is not None:
|
|
|
|
|
for p in paths_buf:
|
|
|
|
|
st = os.stat(p)
|
|
|
|
|
if st.st_mode & refuse_mode_mask:
|
|
|
|
|
for item in tree.child_list():
|
|
|
|
|
if item.content is None:
|
|
|
|
|
continue
|
2026-06-10 13:28:35 +02:00
|
|
|
if not re.search('password|secret',
|
mypy: Fix any_generics, redundant_casts, unused_ignores
Add mypy directives disallow_any_generics, warn_redundant_casts, and
warn_unused_ignores. Fix all resulting type annotation errors:
- load_yaml.py: Add type arguments to dict, tuple, set annotations; fix
resolving dict/set types for link keys; handle str|int path types.
- misc.py: Add Mapping[str, Any] and Iterable[Any] type arguments; fix
multiline export comment to avoid bad pattern flag.
- multi_key_dict.py: Add type argument to dict[tuple, Any].
- StringTree.py: Move Any import out of TYPE_CHECKING; fix MutableMapping
type args.
- serdes.py: Add type argument to re.Match.
- Config.py: Change Config from Mapping to Mapping[str, str]; remove
unused cast.
- ev/base/Object.py, SimpleObject.py, EventLogger.py, PollerOneShot.py:
Add Mapping[str, Any] type args.
- ev/app/EventRouter.py: Add dict[str, Any] type args in inner functions.
- auth/*: Remove now-unnecessary # type: ignore[return-value] comments.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.82.0
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 19:25:57 +02:00
|
|
|
item.content,
|
2026-06-10 13:28:35 +02:00
|
|
|
flags = re.IGNORECASE):
|
2025-01-30 09:54:03 +01:00
|
|
|
continue
|
2026-06-10 13:28:35 +02:00
|
|
|
msg = (
|
|
|
|
|
'Config files define secret, but at least one '
|
|
|
|
|
'has file permissions open for world'
|
|
|
|
|
)
|
2025-01-30 09:54:03 +01:00
|
|
|
slog(ERR, f'{msg}:')
|
|
|
|
|
for pp in paths_buf:
|
2026-06-10 13:28:35 +02:00
|
|
|
mode = (os.stat(pp).st_mode) & 0o7777
|
|
|
|
|
slog(ERR, f' {mode:o} {pp}')
|
2025-01-30 09:54:03 +01:00
|
|
|
raise Exception(msg)
|
2025-01-20 11:39:56 +01:00
|
|
|
tree.dump(DEBUG, f)
|
2025-01-28 08:05:16 +01:00
|
|
|
ret.add("", tree)
|
|
|
|
|
return ret
|
|
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
def __init__(
|
|
|
|
|
self,
|
2026-07-14 14:53:56 +02:00
|
|
|
search_dirs: list[str] | None = None,
|
|
|
|
|
glob_paths: list[str] | None = None,
|
|
|
|
|
glob_paths_env_key: str | None = None,
|
|
|
|
|
defaults: dict[str, str] | None = None,
|
|
|
|
|
tree: StringTree | None = None,
|
|
|
|
|
parent: Config | None = None,
|
|
|
|
|
root_section: str | None = None,
|
2026-07-14 14:51:26 +02:00
|
|
|
refuse_mode_mask: int = _REFUSE_MODE_MASK
|
2026-06-10 13:28:35 +02:00
|
|
|
) -> None:
|
2025-01-28 08:05:16 +01:00
|
|
|
|
|
|
|
|
self.__parent = parent
|
|
|
|
|
|
|
|
|
|
if tree is not None:
|
2026-06-10 13:28:35 +02:00
|
|
|
assert (search_dirs is None)
|
|
|
|
|
assert (glob_paths is None)
|
|
|
|
|
assert (glob_paths_env_key is None)
|
2025-01-28 08:05:16 +01:00
|
|
|
self.__conf = tree
|
|
|
|
|
else:
|
2026-06-10 13:28:35 +02:00
|
|
|
assert (tree is None)
|
2025-03-12 13:37:32 +01:00
|
|
|
if glob_paths_env_key is not None:
|
|
|
|
|
glob_paths_env = os.getenv(glob_paths_env_key)
|
|
|
|
|
if glob_paths_env is not None:
|
|
|
|
|
if glob_paths is None:
|
|
|
|
|
glob_paths = []
|
|
|
|
|
glob_paths.extend(glob_paths_env.split(':'))
|
|
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
self.__conf = self.__load(
|
|
|
|
|
search_dirs = search_dirs,
|
|
|
|
|
glob_paths = glob_paths,
|
|
|
|
|
refuse_mode_mask = refuse_mode_mask
|
|
|
|
|
)
|
2025-01-20 11:39:56 +01:00
|
|
|
|
|
|
|
|
if root_section is not None:
|
2025-01-29 16:51:07 +01:00
|
|
|
tmp = self.__conf.get(root_section)
|
|
|
|
|
if tmp is None:
|
|
|
|
|
tmp = StringTree("", "")
|
|
|
|
|
self.__conf = tmp
|
2025-01-20 11:39:56 +01:00
|
|
|
|
|
|
|
|
if defaults is not None:
|
|
|
|
|
for key, val in defaults.items():
|
|
|
|
|
if self.__conf.get(key) is None:
|
2025-01-29 16:51:07 +01:00
|
|
|
self.__conf[key] = val
|
2025-01-20 11:39:56 +01:00
|
|
|
|
|
|
|
|
self.__conf.dump(DEBUG, "superposed configuration")
|
|
|
|
|
|
2026-07-14 15:26:23 +02:00
|
|
|
@override
|
2025-10-13 12:45:51 +02:00
|
|
|
def __getitem__(self, key: str) -> str:
|
2025-06-06 13:39:24 +02:00
|
|
|
ret = self.get(key)
|
|
|
|
|
if ret is None:
|
|
|
|
|
raise KeyError(key)
|
|
|
|
|
return ret
|
2025-01-20 11:39:56 +01:00
|
|
|
|
2026-07-14 15:26:23 +02:00
|
|
|
@override
|
|
|
|
|
def __iter__(self) -> Iterator[str]:
|
|
|
|
|
return iter(self.__conf)
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
def __len__(self) -> int:
|
|
|
|
|
return len(self.__conf)
|
|
|
|
|
|
2026-07-14 14:53:56 +02:00
|
|
|
def __setitem__(self, key: str, value: str) -> None:
|
|
|
|
|
self.set(key, value)
|
2025-05-20 13:11:14 +02:00
|
|
|
|
2025-01-20 11:39:56 +01:00
|
|
|
@property
|
2026-07-14 14:53:56 +02:00
|
|
|
def parent(self) -> Config | None:
|
2025-01-20 11:39:56 +01:00
|
|
|
return self.__parent
|
|
|
|
|
|
2025-05-20 13:10:53 +02:00
|
|
|
@property
|
2026-07-14 14:53:56 +02:00
|
|
|
def root(self) -> Config:
|
2025-05-20 13:10:53 +02:00
|
|
|
if self.__parent is None:
|
|
|
|
|
return self
|
|
|
|
|
return self.__parent.root
|
|
|
|
|
|
2026-07-14 14:53:56 +02:00
|
|
|
def set(self, key: str, val: str) -> None:
|
2025-01-20 11:39:56 +01:00
|
|
|
self.__conf[key] = val
|
|
|
|
|
|
2026-07-14 15:26:23 +02:00
|
|
|
# Narrowing default and return value from Any to str by overriding
|
|
|
|
|
# Mapping.get(). That will work for all callers but isn't accepted by mypy,
|
|
|
|
|
# so ignore[override].
|
|
|
|
|
@override
|
|
|
|
|
def get( # type: ignore[override]
|
|
|
|
|
self,
|
|
|
|
|
key: str,
|
|
|
|
|
default: str | None = None
|
|
|
|
|
) -> str | None:
|
2025-01-20 11:39:56 +01:00
|
|
|
item = self.__conf.get(key)
|
|
|
|
|
if item:
|
|
|
|
|
return item.value()
|
|
|
|
|
return default
|
|
|
|
|
|
2025-02-15 08:20:53 +01:00
|
|
|
def entries(self, key: str) -> list[str]:
|
|
|
|
|
item = self.__conf.get(key)
|
|
|
|
|
if item is None:
|
|
|
|
|
return []
|
|
|
|
|
return [name for name, child in item.children.items()]
|
|
|
|
|
|
2025-01-20 11:39:56 +01:00
|
|
|
# This is an alias for get()
|
2026-07-14 14:53:56 +02:00
|
|
|
def value(self, key: str, default: str | None = None) -> str | None:
|
2025-01-20 11:39:56 +01:00
|
|
|
return self.get(key, default)
|
|
|
|
|
|
2026-07-14 14:51:32 +02:00
|
|
|
def branch(self, path: str, throw: bool = True) -> Config | None:
|
2025-01-20 11:39:56 +01:00
|
|
|
if self.__conf:
|
2025-02-15 08:19:25 +01:00
|
|
|
tree = self.__conf.get(path)
|
|
|
|
|
if tree is None:
|
|
|
|
|
msg = f'Tried to get non-existent branch "{path}" from config'
|
2025-07-27 18:58:28 +02:00
|
|
|
if not throw:
|
|
|
|
|
slog(DEBUG, msg)
|
|
|
|
|
return None
|
2025-02-15 08:19:25 +01:00
|
|
|
self.dump(ERR, msg)
|
2025-07-27 18:58:28 +02:00
|
|
|
raise Exception(msg)
|
2026-07-14 14:51:32 +02:00
|
|
|
return Config(tree = tree, parent = self)
|
2025-01-20 11:39:56 +01:00
|
|
|
return None
|
|
|
|
|
|
mypy: Fix disallow_incomplete_defs fallout
Add parameter and return type annotations to untyped functions all
over the package:
- ldap.py: Add return types to Config properties (ldap_uri, bind_dn,
bind_pw, base_dn), Connection.__init__, add, delete, walk, find,
__oc_recurse_to_top, object_class_path, and inner callbacks
- cast.py: Add Any import, add return type annotations to
cast_str_to_bool, guess_type, from_str, from_env, cast_str, and
parameter type annotations where missing
- Table.py:
- __init__ (schema: Schema)
- __eq__ (rhs: Any)
- _column_data_type (name: str)
- _column_default (name: str)
- column_default (name: str)
- foreign_keys_to_parent_table (parent_table: Any)
- misc.py:
- get_derived_classes (mod: Any, flt: Any)
- load_classes (flt: Any)
- load_class_names (remove_flt: bool)
- load_object (*args: Any, **kwargs: Any)
- multi_regex_edit (spec: Any)
- dump_dict (*args: Any, **kwargs: Any)
- get_derived_classes (mod: Any, flt: Any)
- load_classes (flt: Any)
- load_class_names (remove_flt: bool)
- load_object (*args: Any, **kwargs: Any)
- dump (*args: Any, **kwargs: Any)
- MapAttr2Shape.py, ShuntingYard.py, Queries.py:
- Add parameter and return type annotations to fix disallow_incomplete_defs:
- MapAttr2Shape.py: __keys, __attribs, __massage_node, __massage_nodes, __add
- ShuntingYard.py: Op.__init__, tokenize, infix_to_postfix, eval_postfix, eval
- Queries.py: _run, _register, name property, __getitem__, keys, load, add, _add
- Add parameter and return type annotations:
- ArgsContainer.py: __setattr__, args, kwargs, dump, specified_args, add_argument
- rows.py: rows_duplicates, rows_check_not_null, rows_dumps, rows_dump
- auth/Auth.py: load, conf, _entity, projects
- auth/ldap/Auth.py: __init__, _create_entity
- Fix parameter type annotations:
- rows_check_not_null: keys: str | list[str], stat_key: str | None, caller: Any
- rows_dumps: lead: str | list[str] | None, tablefmt: str | None
- rows_dump: heading: str | None, lead: str | list[str] | None, tablefmt: str | None
- Table.py: column_default, add_row_location, add_child_row_location
- CompositeForeignKey.py: __table, parent_column, child_column
- TableIoHandler.py: _load, _store, load
- Query.py: _register, register, parent property
- Ldap.py: Entity.__init__, Ldap.__init__, _create_entity
- MapAttr2Shape.py, auth/ldap/Auth.py, Query.py:
- MapAttr2Shape.py: Add None check for id, add None check for graph
- auth/ldap/Auth.py: Add Any import, fix __init__ and _create_entity
- Query.py: Fix _add, run, parent signatures
- ArgsContainer.py: __setattr__, args, kwargs, dump, specified_args, add_argument
- Config.py: dump
- ShuntingYard.py: Op.__init__, tokenize, infix_to_postfix, eval_postfix, eval
- ShellCmd.py: __init__
- auth/Auth.py: load, __init__
- auth/dummy/Auth.py: Entity.__init__, Auth.__init__
- auth/ldap/Auth.py: Entity.__init__, Auth.__init__, _create_entity
- cast.py: guess_type
- DataBase.py: _create_session, _delete_session
- TableIoHandler.py: load
- Query.py: _run, _register, register, _add, run, parent/db properties
- QueryResult.py: pages, _cast
- rows.py: rows_duplicates, rows_check_not_null, rows_dumps, rows_dump
- Column.py: __eq__, foreign_key
- Schema.py: _access_defining_columns, access_defining_columns, table_by_model_name
- Table.py: __init__, __eq__, _column_data_type, _column_default, column_default,
__relationship_by_foreign_table, add_row_location, add_child_row_location
- utils.py: check_schema
- EventRouter.py: iter_peers
- Group.py: __init__
- SimpleEntity.py: __init__
- Ldap.py: Entity.__init__, Ldap.__init__, _create_entity
- Event.py: __init__
- Fuse.py: __init__
- Object.py: __init__
- SimpleObject.py: __init__, create
- EvRequest.py: __init__
- Msg.py: __init__
- ldap.py: Config.__get__, Config properties, Connection methods, inner callbacks
- misc.py: get_derived_classes, load_classes, load_class_names, load_object,
multi_regex_edit, dump_dict, dump
- multi_key_dict.py: items
- MapAttr2Shape.py: __keys, __attribs, __massage_node, __massage_nodes, __add
- auth/dummy/Auth.py: Entity.__init__, Auth.__init__
- Query.py: _run, _register, register, _add, run, parent/db properties
- QueryResult.py: pages, _cast
- Column.py: __eq__, foreign_key
- Schema.py: _access_defining_columns, access_defining_columns, table_by_model_name
- Table.py: __init__, __eq__, _column_data_type, _column_default, column_default,
__relationship_by_foreign_table, add_row_location, add_child_row_location
- utils.py: check_schema
- EventRouter.py: iter_peers
- Group.py: __init__
- SimpleEntity.py: __init__
- Ldap.py: Entity.__init__, Ldap.__init__, _create_entity
- Event.py: __init__
- Fuse.py: __init__
- Object.py: __init__
- SimpleObject.py: __init__, create
- EvRequest.py: __init__
- Msg.py: __init__
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.82.0
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 22:34:10 +02:00
|
|
|
def dump(self, prio: int, *args: Any, **kwargs: Any) -> None:
|
2025-01-20 11:39:56 +01:00
|
|
|
caller = get_caller_pos(1, kwargs)
|
2026-06-10 13:28:35 +02:00
|
|
|
self.__conf.dump(prio, caller = caller, *args, **kwargs)
|
2025-05-12 18:53:04 +02:00
|
|
|
|
|
|
|
|
@property
|
2026-07-14 14:53:56 +02:00
|
|
|
def name(self) -> str | None:
|
2025-05-12 18:53:04 +02:00
|
|
|
return self.__conf.content
|
2025-05-29 12:05:10 +02:00
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
def find(
|
|
|
|
|
self,
|
|
|
|
|
key: str | None,
|
|
|
|
|
val: str | None,
|
|
|
|
|
match: StringTree.Match = StringTree.Match.Equal
|
|
|
|
|
) -> list[str]:
|
|
|
|
|
return self.__conf.find(key, val, match = match)
|
2025-05-29 12:05:10 +02:00
|
|
|
|
|
|
|
|
#def __getattr__(self, name: str):
|
|
|
|
|
# return getattr(self.__conf, name)
|