diff options
| author | Simeon Simeonov | 2026-06-01 23:15:34 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2026-06-01 23:15:34 +0200 |
| commit | f1120d3746dfc3448b0ca861140660abcb828257 (patch) | |
| tree | 5251295c2dc153e40b56b1bf29ffc3af4e59b709 | |
| parent | 7fd7db9cd12d59f7c523dc2a1a167f7445e5b2f3 (diff) | |
| -rw-r--r-- | src/etoolkit/__init__.py | 2 | ||||
| -rw-r--r-- | src/etoolkit/etoolkit.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/etoolkit/__init__.py b/src/etoolkit/__init__.py index 416be15..c4b43da 100644 --- a/src/etoolkit/__init__.py +++ b/src/etoolkit/__init__.py | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | from .etoolkit import EtoolkitInstance, EtoolkitInstanceError | 18 | from .etoolkit import EtoolkitInstance, EtoolkitInstanceError |
| 19 | 19 | ||
| 20 | __author__ = 'Simeon Simeonov' | 20 | __author__ = 'Simeon Simeonov' |
| 21 | __version__ = '2.3.0' | 21 | __version__ = '2.3.1' |
| 22 | __license__ = 'GPL3' | 22 | __license__ = 'GPL3' |
| 23 | 23 | ||
| 24 | 24 | ||
diff --git a/src/etoolkit/etoolkit.py b/src/etoolkit/etoolkit.py index 9369571..194a2bb 100644 --- a/src/etoolkit/etoolkit.py +++ b/src/etoolkit/etoolkit.py | |||
| @@ -75,11 +75,13 @@ class EtoolkitInstance: | |||
| 75 | self._instance_data = data['instances'][name] | 75 | self._instance_data = data['instances'][name] |
| 76 | except KeyError as err: | 76 | except KeyError as err: |
| 77 | raise EtoolkitInstanceError(f'Unknown instance "{name}"') from err | 77 | raise EtoolkitInstanceError(f'Unknown instance "{name}"') from err |
| 78 | |||
| 78 | if self._instance_data.get('ETOOLKIT_PARENT'): | 79 | if self._instance_data.get('ETOOLKIT_PARENT'): |
| 79 | self._parent = EtoolkitInstance( | 80 | self._parent = EtoolkitInstance( |
| 80 | self._instance_data['ETOOLKIT_PARENT'], data | 81 | self._instance_data['ETOOLKIT_PARENT'], data |
| 81 | ) | 82 | ) |
| 82 | self._raw_env_variables.update(self._parent.raw_env_variables) | 83 | self._raw_env_variables.update(self._parent.raw_env_variables) |
| 84 | |||
| 83 | if self._instance_data.get('ETOOLKIT_SENSITIVE'): | 85 | if self._instance_data.get('ETOOLKIT_SENSITIVE'): |
| 84 | if not isinstance(self._instance_data['ETOOLKIT_SENSITIVE'], list): | 86 | if not isinstance(self._instance_data['ETOOLKIT_SENSITIVE'], list): |
| 85 | raise EtoolkitInstanceError( | 87 | raise EtoolkitInstanceError( |
| @@ -88,10 +90,12 @@ class EtoolkitInstance: | |||
| 88 | self._sensitive_env_variables.extend( | 90 | self._sensitive_env_variables.extend( |
| 89 | self._instance_data['ETOOLKIT_SENSITIVE'] | 91 | self._instance_data['ETOOLKIT_SENSITIVE'] |
| 90 | ) | 92 | ) |
| 93 | |||
| 91 | self._raw_env_variables.update(self._instance_data) | 94 | self._raw_env_variables.update(self._instance_data) |
| 92 | # remove non env. variable data | 95 | # remove non env. variable data |
| 93 | self._raw_env_variables.pop('ETOOLKIT_PARENT', None) | 96 | self._raw_env_variables.pop('ETOOLKIT_PARENT', None) |
| 94 | self._raw_env_variables.pop('ETOOLKIT_SENSITIVE', None) | 97 | self._raw_env_variables.pop('ETOOLKIT_SENSITIVE', None) |
| 98 | |||
| 95 | if 'general' in data and 'MASTER_PASSWORD_HASH' in data['general']: | 99 | if 'general' in data and 'MASTER_PASSWORD_HASH' in data['general']: |
| 96 | self._master_password_hash = data['general'][ | 100 | self._master_password_hash = data['general'][ |
| 97 | 'MASTER_PASSWORD_HASH' | 101 | 'MASTER_PASSWORD_HASH' |
| @@ -570,8 +574,8 @@ class EtoolkitInstance: | |||
| 570 | :return: Decrypted value | 574 | :return: Decrypted value |
| 571 | :rtype: str | 575 | :rtype: str |
| 572 | """ | 576 | """ |
| 573 | if self._master_password is not None: | 577 | if self.master_password is not None: |
| 574 | master_password = self._master_password | 578 | master_password = self.master_password |
| 575 | else: | 579 | else: |
| 576 | # master password not set for this instance | 580 | # master password not set for this instance |
| 577 | if self._prompt_func is None: | 581 | if self._prompt_func is None: |
