2026-06-10 13:28:35 +02:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import copy
|
|
|
|
|
import getpass
|
|
|
|
|
import pathlib
|
2025-07-26 13:51:42 +02:00
|
|
|
|
|
|
|
|
from enum import Flag, auto
|
2026-06-10 13:28:35 +02:00
|
|
|
from typing import TYPE_CHECKING, Any, Self
|
2025-07-26 13:51:42 +02:00
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
import ldap # type: ignore[import-untyped]
|
|
|
|
|
import networkx as nx # type: ignore[import-untyped]
|
|
|
|
|
|
|
|
|
|
from ldap.schema.models import ObjectClass # type: ignore[import-untyped]
|
|
|
|
|
|
|
|
|
|
from .log import ERR, INFO, WARNING, slog
|
|
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
|
from collections.abc import Callable
|
|
|
|
|
|
|
|
|
|
from .Config import Config as BaseConfig
|
2025-07-26 13:51:42 +02:00
|
|
|
|
|
|
|
|
class Config:
|
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
|
|
|
__ldap_uri: str | None
|
|
|
|
|
__bind_dn: str | None
|
|
|
|
|
__bind_pw: str | None
|
|
|
|
|
__base_dn: str | None
|
2026-06-10 13:28:35 +02:00
|
|
|
|
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 __init__(self, external: BaseConfig | None = None) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__external = external
|
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
|
|
|
self.__ldap_uri = None
|
|
|
|
|
self.__bind_dn = None
|
|
|
|
|
self.__bind_pw = None
|
|
|
|
|
self.__base_dn = None
|
2025-07-26 13:51:42 +02:00
|
|
|
|
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 __get(self, key: str, default: str | None) -> str | None:
|
2025-07-26 13:51:42 +02:00
|
|
|
if not self.__external:
|
|
|
|
|
return default
|
2026-06-10 13:28:35 +02:00
|
|
|
return self.__external.value(key, default = default)
|
2025-07-26 13:51:42 +02:00
|
|
|
|
|
|
|
|
@property
|
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 ldap_uri(self) -> str | None:
|
2025-07-26 13:51:42 +02:00
|
|
|
if self.__ldap_uri is None:
|
2026-03-31 17:28:17 +02:00
|
|
|
for key in ['ldap_uri', 'uri']:
|
2026-06-10 13:28:35 +02:00
|
|
|
self.__ldap_uri = self.__get(key, default = None)
|
2026-03-31 17:28:17 +02:00
|
|
|
if self.__ldap_uri is not None:
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
self.__ldap_uri = 'ldap://ldap.janware.com'
|
2025-07-26 13:51:42 +02:00
|
|
|
return self.__ldap_uri
|
2026-06-10 13:28:35 +02:00
|
|
|
|
2025-07-26 13:51:42 +02:00
|
|
|
@ldap_uri.setter
|
mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all
191 'no-untyped-def' mypy errors in strict mode.
The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch,
Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session,
rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult,
and all db/schema files (Column, Table, ColumnSet, DataType, Schema,
SingleForeignKey, CompositeForeignKey), plus asyncio variants and
ev/base/Object and auth/dummy/Auth.
Additionally, unreachable code and type annotation conflicts were
resolved in StopWatch.py, Options.py, rows.py, and Table.py.
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-25 10:24:57 +02:00
|
|
|
def ldap_uri(self, rhs: str | None) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__ldap_uri = rhs
|
|
|
|
|
|
|
|
|
|
@property
|
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 bind_dn(self) -> str | None:
|
2025-07-26 13:51:42 +02:00
|
|
|
if self.__bind_dn is None:
|
2026-06-10 13:28:35 +02:00
|
|
|
self.__bind_dn = self.__get(
|
|
|
|
|
'bind_dn',
|
|
|
|
|
default = f'uid={getpass.getuser()},ou=users,dc=jannet,dc=de'
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
return self.__bind_dn
|
2026-06-10 13:28:35 +02:00
|
|
|
|
2025-07-26 13:51:42 +02:00
|
|
|
@bind_dn.setter
|
mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all
191 'no-untyped-def' mypy errors in strict mode.
The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch,
Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session,
rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult,
and all db/schema files (Column, Table, ColumnSet, DataType, Schema,
SingleForeignKey, CompositeForeignKey), plus asyncio variants and
ev/base/Object and auth/dummy/Auth.
Additionally, unreachable code and type annotation conflicts were
resolved in StopWatch.py, Options.py, rows.py, and Table.py.
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-25 10:24:57 +02:00
|
|
|
def bind_dn(self, rhs: str | None) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__bind_dn = rhs
|
|
|
|
|
|
|
|
|
|
@property
|
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 bind_pw(self) -> str | None:
|
2025-07-26 13:51:42 +02:00
|
|
|
if self.__bind_pw is 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
|
|
|
ret: str | None = None
|
2025-09-11 22:33:47 +02:00
|
|
|
for key in ['bind_pw', 'password']:
|
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
|
|
|
val = self.__get(key, default = None)
|
|
|
|
|
if val is not None:
|
|
|
|
|
ret = val
|
2025-09-11 22:33:47 +02:00
|
|
|
break
|
2025-07-26 13:51:42 +02:00
|
|
|
if ret is None:
|
2026-06-10 13:28:35 +02:00
|
|
|
ldap_secret_file = self.__get(
|
|
|
|
|
'secret_file', f'{pathlib.Path.home()}/.ldap.secret'
|
|
|
|
|
)
|
|
|
|
|
assert ldap_secret_file is not None, 'ldap_secret_file'
|
2025-07-26 13:51:42 +02:00
|
|
|
with open(ldap_secret_file, 'r') as file:
|
|
|
|
|
ret = file.read()
|
|
|
|
|
file.closed
|
|
|
|
|
ret = ret.strip()
|
|
|
|
|
self.__bind_pw = ret
|
|
|
|
|
return self.__bind_pw
|
2026-06-10 13:28:35 +02:00
|
|
|
|
2025-07-26 13:51:42 +02:00
|
|
|
@bind_pw.setter
|
mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all
191 'no-untyped-def' mypy errors in strict mode.
The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch,
Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session,
rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult,
and all db/schema files (Column, Table, ColumnSet, DataType, Schema,
SingleForeignKey, CompositeForeignKey), plus asyncio variants and
ev/base/Object and auth/dummy/Auth.
Additionally, unreachable code and type annotation conflicts were
resolved in StopWatch.py, Options.py, rows.py, and Table.py.
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-25 10:24:57 +02:00
|
|
|
def bind_pw(self, rhs: str | None) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__bind_pw = rhs
|
|
|
|
|
|
|
|
|
|
@property
|
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 base_dn(self) -> str | None:
|
2025-07-26 13:51:42 +02:00
|
|
|
if self.__base_dn is None:
|
2026-06-10 13:28:35 +02:00
|
|
|
self.__base_dn = self.__get('base_dn', default = 'dc=jannet,dc=de')
|
2025-07-26 13:51:42 +02:00
|
|
|
return self.__base_dn
|
2026-06-10 13:28:35 +02:00
|
|
|
|
2025-07-26 13:51:42 +02:00
|
|
|
@base_dn.setter
|
mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all
191 'no-untyped-def' mypy errors in strict mode.
The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch,
Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session,
rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult,
and all db/schema files (Column, Table, ColumnSet, DataType, Schema,
SingleForeignKey, CompositeForeignKey), plus asyncio variants and
ev/base/Object and auth/dummy/Auth.
Additionally, unreachable code and type annotation conflicts were
resolved in StopWatch.py, Options.py, rows.py, and Table.py.
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-25 10:24:57 +02:00
|
|
|
def base_dn(self, rhs: str | None) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__base_dn = rhs
|
|
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
class Connection: # export
|
2025-07-26 13:51:42 +02:00
|
|
|
|
|
|
|
|
class AttrType(Flag):
|
|
|
|
|
Must = auto()
|
2026-06-10 13:28:35 +02:00
|
|
|
May = auto()
|
2025-07-26 13:51:42 +02:00
|
|
|
|
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 __init__(
|
|
|
|
|
self, conf: Config | BaseConfig | None = None, backtrace: bool = False
|
|
|
|
|
):
|
2026-06-10 13:28:35 +02:00
|
|
|
uri: str | None = None
|
2025-07-26 13:51:42 +02:00
|
|
|
c = conf if isinstance(conf, Config) else Config(conf)
|
2026-03-31 17:28:17 +02:00
|
|
|
try:
|
|
|
|
|
uri = c.ldap_uri
|
2026-06-10 13:28:35 +02:00
|
|
|
except Exception:
|
|
|
|
|
# mypy says: E: "Config" has no attribute "uri" [attr-defined]
|
|
|
|
|
# FIXME: Who adds .uri?
|
2026-07-24 18:14:24 +02:00
|
|
|
uri = c.uri # type: ignore[attr-defined]
|
2026-03-31 17:28:17 +02:00
|
|
|
try:
|
|
|
|
|
ret = ldap.initialize(uri)
|
|
|
|
|
ret.start_tls_s()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
slog(ERR, f'Failed to initialize LDAP connection to "{uri}" ({str(e)})')
|
|
|
|
|
raise
|
2025-07-26 13:51:42 +02:00
|
|
|
try:
|
2026-06-10 13:28:35 +02:00
|
|
|
ret.bind_s(c.bind_dn, c.bind_pw) # method)
|
2025-07-26 13:51:42 +02:00
|
|
|
except Exception as e:
|
2026-03-31 17:28:17 +02:00
|
|
|
slog(ERR, f'Failed to bind to "{uri}" with dn "{c.bind_dn}" ({str(e)})')
|
|
|
|
|
raise
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__ldap = ret
|
|
|
|
|
self.__backtrace = backtrace
|
2026-06-10 13:28:35 +02:00
|
|
|
self.__object_classes_by_oid: dict[str, ObjectClass] | None = None
|
|
|
|
|
self.__object_class_tree: nx.Graph | None = None
|
|
|
|
|
self.__object_classes_by_name: dict[str, ObjectClass] | None = None
|
2025-07-26 13:51:42 +02:00
|
|
|
|
|
|
|
|
@property
|
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 ldap(self) -> Any:
|
2025-07-26 13:51:42 +02:00
|
|
|
return self.__ldap
|
|
|
|
|
|
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 add(self, attrs: dict[str, bytes], dn: str | None = None) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
if dn is None:
|
2026-06-10 13:28:35 +02:00
|
|
|
if 'dn' not in attrs:
|
2025-07-26 13:51:42 +02:00
|
|
|
raise Exception('No DN to add an LDAP entry to')
|
2025-10-13 12:45:51 +02:00
|
|
|
attrs = copy.deepcopy(attrs)
|
|
|
|
|
del attrs['dn']
|
2025-07-26 13:51:42 +02:00
|
|
|
try:
|
|
|
|
|
slog(INFO, f'LDAP: Add [{dn}] -> {attrs}')
|
2026-06-10 13:28:35 +02:00
|
|
|
ml =ldap.modlist.addModlist( # pyright: ignore[reportAttributeAccessIssue]
|
|
|
|
|
attrs
|
|
|
|
|
)
|
|
|
|
|
self.__ldap.add_s(dn, ml)
|
2025-07-26 13:51:42 +02:00
|
|
|
except Exception as e:
|
|
|
|
|
slog(ERR, f'{dn}: Failed to add entry {attrs} ({e})')
|
|
|
|
|
raise
|
|
|
|
|
|
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 delete(
|
|
|
|
|
self, dn: str, recursive: bool = False, force_existence: bool = False
|
|
|
|
|
) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
|
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 __walk_cb_delete(conn: Connection, entry: Any, context: Any) -> None:
|
2026-06-10 13:28:35 +02:00
|
|
|
self.walk(
|
|
|
|
|
__walk_cb_delete,
|
|
|
|
|
base = entry[0],
|
|
|
|
|
scope = ldap.
|
|
|
|
|
SCOPE_ONELEVEL, # pyright: ignore[reportAttributeAccessIssue]
|
|
|
|
|
context = context
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__ldap.delete_s(entry[0])
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
if recursive:
|
2026-06-10 13:28:35 +02:00
|
|
|
self.walk(
|
|
|
|
|
__walk_cb_delete,
|
|
|
|
|
dn,
|
|
|
|
|
scope = ldap.
|
|
|
|
|
SCOPE_ONELEVEL # pyright: ignore[reportAttributeAccessIssue]
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__ldap.delete_s(dn)
|
|
|
|
|
else:
|
|
|
|
|
self.__ldap.delete_s(dn)
|
2026-06-10 13:28:35 +02:00
|
|
|
except ldap.NO_SUCH_OBJECT: # pyright: ignore[reportAttributeAccessIssue]
|
2025-07-26 13:51:42 +02:00
|
|
|
if force_existence:
|
|
|
|
|
raise
|
|
|
|
|
except Exception as e:
|
|
|
|
|
slog(ERR, f'Failed to delete {dn} ({e})')
|
|
|
|
|
raise
|
|
|
|
|
|
2026-03-31 17:28:38 +02:00
|
|
|
def walk(
|
2026-06-10 13:28:35 +02:00
|
|
|
self,
|
|
|
|
|
callback: Callable[[Self, Any, Any], None],
|
|
|
|
|
base: str,
|
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
|
|
|
scope: Any,
|
|
|
|
|
context: Any = None,
|
|
|
|
|
filterstr: Any = None,
|
|
|
|
|
attrlist: Any = None,
|
|
|
|
|
attrsonly: int = 0,
|
|
|
|
|
serverctrls: Any = None,
|
|
|
|
|
clientctrls: Any = None,
|
|
|
|
|
timeout: int = -1,
|
|
|
|
|
sizelimit: int = 0,
|
2026-06-10 13:28:35 +02:00
|
|
|
decode: bool = False,
|
|
|
|
|
unroll: bool = False
|
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
|
|
|
) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
|
|
|
|
|
# TODO: Support ignored arguments
|
2026-06-10 13:28:35 +02:00
|
|
|
search_return = self.__ldap.search(
|
|
|
|
|
base = base,
|
|
|
|
|
scope = scope,
|
|
|
|
|
filterstr = filterstr,
|
|
|
|
|
attrlist = attrlist,
|
|
|
|
|
attrsonly = attrsonly
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
while True:
|
|
|
|
|
result_type, result_data = self.__ldap.result(search_return, 0)
|
2026-06-10 13:28:35 +02:00
|
|
|
if (not result_data):
|
2025-07-26 13:51:42 +02:00
|
|
|
break
|
2026-06-10 13:28:35 +02:00
|
|
|
if result_type != ldap.RES_SEARCH_ENTRY: # pyright: ignore[reportAttributeAccessIssue]
|
2025-07-26 13:51:42 +02:00
|
|
|
continue
|
|
|
|
|
for entry in result_data:
|
2026-03-31 17:28:38 +02:00
|
|
|
if decode:
|
2026-06-10 13:28:35 +02:00
|
|
|
entry = entry[0], {
|
|
|
|
|
key: [val.decode() for val in vals]
|
|
|
|
|
for key, vals in entry[1].items()
|
|
|
|
|
}
|
2025-07-26 13:51:42 +02:00
|
|
|
try:
|
|
|
|
|
callback(self, entry, context)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
msg = f'Exception {e}'
|
|
|
|
|
if self.__backtrace:
|
|
|
|
|
slog(ERR, msg)
|
|
|
|
|
raise
|
|
|
|
|
slog(WARNING, msg)
|
|
|
|
|
continue
|
|
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
def find(
|
|
|
|
|
self,
|
|
|
|
|
base: str,
|
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
|
|
|
scope: Any,
|
|
|
|
|
filterstr: Any = None,
|
|
|
|
|
attrlist: Any = None,
|
|
|
|
|
attrsonly: int = 0,
|
|
|
|
|
serverctrls: Any = None,
|
|
|
|
|
clientctrls: Any = None,
|
|
|
|
|
timeout: int = -1,
|
|
|
|
|
sizelimit: int = 0,
|
|
|
|
|
assert_unique: bool = False,
|
|
|
|
|
assert_not_empty: bool = False,
|
|
|
|
|
) -> list[Any]:
|
2025-07-26 13:51:42 +02:00
|
|
|
|
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 __walk_cb_find(conn: Connection, entry: Any, context: Any) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
result.append(entry)
|
|
|
|
|
|
mypy: Fix disallow_untyped_calls check fallout
Add return type annotations and parameter type hints to previously
untyped functions, preparing for disallow_untyped_calls enforcement:
- ArgsContainer.py: keys() -> Iterable[str]
- Object.py: Object.__init__() -> None
- ShuntingYard.py: tokenize(), infix_to_postfix(), __init__(),
add_operator(), Stack methods, debug(), Calculator/Matcher.__init__()
- ShellCmd.py: __exec(), __cleanup(), init(), cleanup(), __init__()
- Auth.py: __bind() -> Connection, import Connection
- TableIoHandler.py: _check_non_nullable() -> None, buf annotation
- Queries.py: _add() -> None
- rows.py: __equal(), rows_duplicates(), rows_check_not_null(),
rows_dump(), rows_dumps() with proper type signatures
- CompositeForeignKey.py: __table() -> Table
- EventRouter.py: iter_peers() -> Iterator[tuple[str, Any]]
- MapAttr2Shape.py: __value(), __add_key_nodegraphics()
- ldap.py: __search() -> str, collect() -> set[str]
- multi_key_dict.py: has_key(), get_other_keys(), iterkeys(),
get_values_from_str(), test_multi_key_dict(), __init__(),
items_dict annotation
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:02:28 +02:00
|
|
|
def __search() -> str:
|
2025-07-26 13:51:42 +02:00
|
|
|
return f'{base} -> "{filterstr}"'
|
|
|
|
|
|
|
|
|
|
try:
|
2025-10-13 12:45:51 +02:00
|
|
|
result: list[Any] = []
|
2026-06-10 13:28:35 +02:00
|
|
|
self.walk(
|
|
|
|
|
__walk_cb_find,
|
|
|
|
|
base,
|
|
|
|
|
scope = scope,
|
|
|
|
|
filterstr = filterstr,
|
|
|
|
|
attrlist = attrlist
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
except Exception as e:
|
|
|
|
|
slog(ERR, f'Failed search {__search()} ({e})')
|
|
|
|
|
raise
|
|
|
|
|
if assert_not_empty and not result:
|
|
|
|
|
raise Exception(f'Empty result for search {__search()}')
|
|
|
|
|
if assert_unique and len(result) > 1:
|
|
|
|
|
raise Exception(f'Found {len(result)} results for search {__search()}')
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
@property
|
2025-10-13 12:45:51 +02:00
|
|
|
def object_classes(self) -> dict[str, ObjectClass]:
|
2026-06-10 13:28:35 +02:00
|
|
|
#def object_classes(self):
|
2025-10-13 12:45:51 +02:00
|
|
|
if self.__object_classes_by_oid is None:
|
2026-06-10 13:28:35 +02:00
|
|
|
res = self.find(
|
|
|
|
|
base = '',
|
|
|
|
|
scope = ldap.SCOPE_BASE, # pyright: ignore[reportAttributeAccessIssue]
|
|
|
|
|
filterstr = '(objectClass=*)',
|
|
|
|
|
attrlist = ['subschemaSubentry']
|
|
|
|
|
)
|
|
|
|
|
dn = res[0][1]['subschemaSubentry'][0].decode(
|
|
|
|
|
'utf-8'
|
|
|
|
|
) # Usually yields cn=Subschema
|
|
|
|
|
res = self.find(
|
|
|
|
|
base = dn,
|
|
|
|
|
scope = ldap.SCOPE_BASE, # pyright: ignore[reportAttributeAccessIssue]
|
|
|
|
|
filterstr = '(objectClass=*)',
|
|
|
|
|
attrlist = ['*', '+']
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
subschema_entry = res[0]
|
2026-06-10 13:28:35 +02:00
|
|
|
subschema_subentry = ldap.cidict.cidict( # pyright: ignore[reportAttributeAccessIssue]
|
|
|
|
|
subschema_entry[1]
|
|
|
|
|
)
|
|
|
|
|
subschema = ldap.schema.SubSchema( # pyright: ignore[reportAttributeAccessIssue]
|
|
|
|
|
subschema_subentry
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
object_class_oids = subschema.listall(ObjectClass)
|
2025-10-13 12:45:51 +02:00
|
|
|
self.__object_classes_by_oid = {
|
2026-06-10 13:28:35 +02:00
|
|
|
oid: subschema.get_obj(ObjectClass, oid)
|
|
|
|
|
for oid in object_class_oids
|
2025-07-26 13:51:42 +02:00
|
|
|
}
|
2025-10-13 12:45:51 +02:00
|
|
|
return self.__object_classes_by_oid
|
2025-07-26 13:51:42 +02:00
|
|
|
|
|
|
|
|
@property
|
2025-10-13 12:45:51 +02:00
|
|
|
def object_class_by_name(self) -> dict[str, ObjectClass]:
|
2025-07-26 13:51:42 +02:00
|
|
|
if self.__object_classes_by_name is None:
|
|
|
|
|
ret: dict[str, ObjectClass] = {}
|
|
|
|
|
self.__object_classes_by_name = ret
|
|
|
|
|
for oid, oc in self.object_classes.items():
|
|
|
|
|
ret[oid] = oc
|
|
|
|
|
for name in oc.names:
|
|
|
|
|
ret[name] = oc
|
|
|
|
|
ret[name.lower()] = oc
|
|
|
|
|
return self.__object_classes_by_name
|
|
|
|
|
|
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 __oc_recurse_to_top(
|
|
|
|
|
self, cur: str | ObjectClass, cb: Any, context: Any
|
|
|
|
|
) -> None:
|
2026-06-10 13:28:35 +02:00
|
|
|
cur_oc = cur if isinstance(cur, ObjectClass) else self.object_class_by_name[
|
|
|
|
|
cur.lower()]
|
2025-07-26 13:51:42 +02:00
|
|
|
for s in cur_oc.sup:
|
|
|
|
|
self.__oc_recurse_to_top(s, cb, context)
|
|
|
|
|
cb(cur_oc, context)
|
|
|
|
|
|
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 object_class_path(self, leaf: str | ObjectClass) -> Any:
|
2026-06-10 13:28:35 +02:00
|
|
|
|
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 cb(oc: Any, context: Any) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
ret.append(oc)
|
2026-06-10 13:28:35 +02:00
|
|
|
|
2025-10-13 12:45:51 +02:00
|
|
|
ret: list[str] = []
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__oc_recurse_to_top(leaf, cb, None)
|
|
|
|
|
return reversed(ret)
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def object_class_tree(self) -> nx.Graph:
|
|
|
|
|
|
|
|
|
|
if self.__object_class_tree is None:
|
|
|
|
|
|
mypy: Fix disallow_untyped_calls type errors
Add return type annotations and fix type mismatches to satisfy
disallow_untyped_calls:
- ShuntingYard.py: Operator.func -> Any|None, add assert for None
- ShellCmd.py: format_cmdline, __reap, __exec, __cleanup,
SubprocessProtocol.__init__ return types, fix unreachable code
- TableIoHandler.py: cast _load() return to List[Dict[str, Any]]
- rows.py: add cast import, cast rows_dumps() return
- CompositeForeignKey.py: __table() cast fix, remove TYPE_CHECKING
- ldap.py: collect() parameter type ObjectClass
- multi_key_dict.py: get(), itervalues(), test function types,
fix variable name conflicts, add set[Any] annotations
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:20:48 +02:00
|
|
|
def collect(root: ObjectClass, attr: str) -> set[str]:
|
mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all
191 'no-untyped-def' mypy errors in strict mode.
The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch,
Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session,
rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult,
and all db/schema files (Column, Table, ColumnSet, DataType, Schema,
SingleForeignKey, CompositeForeignKey), plus asyncio variants and
ev/base/Object and auth/dummy/Auth.
Additionally, unreachable code and type annotation conflicts were
resolved in StopWatch.py, Options.py, rows.py, and Table.py.
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-25 10:24:57 +02:00
|
|
|
ret: set[str] = set()
|
2026-06-10 13:28:35 +02:00
|
|
|
|
mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all
191 'no-untyped-def' mypy errors in strict mode.
The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch,
Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session,
rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult,
and all db/schema files (Column, Table, ColumnSet, DataType, Schema,
SingleForeignKey, CompositeForeignKey), plus asyncio variants and
ev/base/Object and auth/dummy/Auth.
Additionally, unreachable code and type annotation conflicts were
resolved in StopWatch.py, Options.py, rows.py, and Table.py.
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-25 10:24:57 +02:00
|
|
|
def cb(oc: Any, attr: Any) -> None:
|
2025-07-26 13:51:42 +02:00
|
|
|
vals = getattr(oc, attr)
|
|
|
|
|
if vals is None:
|
|
|
|
|
return
|
|
|
|
|
for val in vals:
|
|
|
|
|
ret.add(val)
|
2026-06-10 13:28:35 +02:00
|
|
|
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__oc_recurse_to_top(root, cb, attr)
|
|
|
|
|
return ret
|
|
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
kind = {0: 'STRUCTURAL', 1: 'ABSTRACT', 2: 'AUXILIARY'}
|
2025-07-26 13:51:42 +02:00
|
|
|
ret = nx.DiGraph()
|
|
|
|
|
for oid, oc in self.object_classes.items():
|
|
|
|
|
ret.add_node(
|
2026-06-10 13:28:35 +02:00
|
|
|
oid,
|
|
|
|
|
oid = oid,
|
|
|
|
|
name = oc.names[0],
|
|
|
|
|
kind = kind[oc.kind],
|
|
|
|
|
must = ', '.join(collect(oc, 'must')),
|
|
|
|
|
may = ', '.join(collect(oc, 'may'))
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
for base_class in oc.sup:
|
|
|
|
|
try:
|
2026-06-10 13:28:35 +02:00
|
|
|
ret.add_edge(
|
|
|
|
|
oid, self.object_class_by_name[base_class.lower()].oid
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
except Exception as e:
|
2026-06-10 13:28:35 +02:00
|
|
|
slog(
|
|
|
|
|
WARNING,
|
|
|
|
|
f'Failed to add edge {oid}:{oc.names} -> {base_class} ({e})'
|
|
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
self.__object_class_tree = ret
|
|
|
|
|
return self.__object_class_tree
|
|
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
def object_class_attrs(
|
|
|
|
|
self,
|
|
|
|
|
oc: str | ObjectClass,
|
|
|
|
|
required: AttrType = AttrType.Must,
|
|
|
|
|
origins: bool = False
|
|
|
|
|
) -> dict[str, set[str]] | set[str]:
|
2025-07-26 13:51:42 +02:00
|
|
|
all_attrs: set[str] = set()
|
|
|
|
|
attrs_by_origin: dict[str, set[str]] = {}
|
|
|
|
|
for oc in self.object_class_path(oc):
|
|
|
|
|
cur = set()
|
|
|
|
|
if required & self.AttrType.Must:
|
2026-06-10 13:28:35 +02:00
|
|
|
cur |= set(oc.must) # pyright: ignore[reportAttributeAccessIssue]
|
2025-07-26 13:51:42 +02:00
|
|
|
if required & self.AttrType.May:
|
2026-06-10 13:28:35 +02:00
|
|
|
cur |= set(oc.may) # pyright: ignore[reportAttributeAccessIssue]
|
2025-07-26 13:51:42 +02:00
|
|
|
if cur:
|
|
|
|
|
all_attrs |= cur
|
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
|
|
|
attrs_by_origin[str(oc)] = cur
|
2025-07-26 13:51:42 +02:00
|
|
|
return attrs_by_origin if origins else all_attrs
|
|
|
|
|
|
mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all
191 'no-untyped-def' mypy errors in strict mode.
The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch,
Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session,
rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult,
and all db/schema files (Column, Table, ColumnSet, DataType, Schema,
SingleForeignKey, CompositeForeignKey), plus asyncio variants and
ev/base/Object and auth/dummy/Auth.
Additionally, unreachable code and type annotation conflicts were
resolved in StopWatch.py, Options.py, rows.py, and Table.py.
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-25 10:24:57 +02:00
|
|
|
def is_derived_class(self, name: str, base_candidate: str) -> bool:
|
2025-07-26 13:51:42 +02:00
|
|
|
#oid = self.object_class_by_name[name].oid
|
|
|
|
|
#base_oid = self.object_class_by_name[base_candidate].oid
|
|
|
|
|
#if base_oid in [oc.oid for oc in self.object_class_path(name)]:
|
|
|
|
|
# return True
|
mypy: Fix no_untyped_defs
Add type annotations to 30 files across jw.util, resolving all
191 'no-untyped-def' mypy errors in strict mode.
The changes cover Signals, CppState, Bunch, RedirectStdIO, StopWatch,
Process, Options, ArgsContainer, Object, multi_key_dict, ldap, Session,
rows, ShuntingYard, TableIoHandler, DataBase, Queries, Query, QueryResult,
and all db/schema files (Column, Table, ColumnSet, DataType, Schema,
SingleForeignKey, CompositeForeignKey), plus asyncio variants and
ev/base/Object and auth/dummy/Auth.
Additionally, unreachable code and type annotation conflicts were
resolved in StopWatch.py, Options.py, rows.py, and Table.py.
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-25 10:24:57 +02:00
|
|
|
return bool(
|
|
|
|
|
nx.has_path(
|
|
|
|
|
self.object_class_tree,
|
|
|
|
|
self.object_class_by_name[name.lower()].oid,
|
|
|
|
|
self.object_class_by_name[base_candidate.lower()].oid
|
|
|
|
|
)
|
2026-06-10 13:28:35 +02:00
|
|
|
)
|
2025-07-26 13:51:42 +02:00
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
def default_config() -> Config: # export
|
2025-07-26 13:51:42 +02:00
|
|
|
return Config()
|
|
|
|
|
|
2026-06-10 13:28:35 +02:00
|
|
|
def bind(conf: Config | BaseConfig | None = None) -> Connection:
|
2025-07-26 13:51:42 +02:00
|
|
|
return Connection(conf)
|