passwords#get_values

This commit is contained in:
Piotr Dec 2025-11-02 23:16:54 +01:00
parent 3c3be6d79c
commit e14180cbe7
Signed by: stawros
GPG key ID: 74B18A3F0F1E99C0

View file

@ -30,7 +30,15 @@ class Passwords:
return Passwords._open_or_create(lock_path, password) return Passwords._open_or_create(lock_path, password)
def get_values(self, keys: list[str]) -> dict[str, str]: def get_values(self, keys: list[str]) -> dict[str, str]:
return {} output = {}
for k in keys:
key_parts = k.split(".")
path = key_parts[:-2] if len(key_parts) > 2 else None
entry_name = key_parts[-2]
field_name = key_parts[-1]
kp_entry = self._kp_org.find_entries(path=path, first=True, name=entry_name)[0]
output[k] = kp_entry[field_name]
return output
def save(self): def save(self):
# nadpisz plik źródłowy zmianami z lock # nadpisz plik źródłowy zmianami z lock