json-database 0.9.1__tar.gz → 0.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {json_database-0.9.1 → json_database-0.10.0}/PKG-INFO +1 -1
- {json_database-0.9.1 → json_database-0.10.0}/json_database/hpm.py +12 -3
- {json_database-0.9.1 → json_database-0.10.0}/json_database/version.py +2 -2
- {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/PKG-INFO +1 -1
- {json_database-0.9.1 → json_database-0.10.0}/LICENSE +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/README.md +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database/__init__.py +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database/crypto.py +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database/exceptions.py +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database/search.py +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database/utils.py +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database/xdg_utils.py +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/SOURCES.txt +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/dependency_links.txt +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/entry_points.txt +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/requires.txt +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/top_level.txt +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/setup.cfg +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/setup.py +0 -0
- {json_database-0.9.1 → json_database-0.10.0}/test/test_crypto.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from hivemind_plugin_manager.database import Client, AbstractDB, cast2client
|
|
2
2
|
from ovos_utils.log import LOG
|
|
3
3
|
from ovos_utils.xdg_utils import xdg_data_home
|
|
4
|
-
from typing import Union, Iterable, List
|
|
5
|
-
from json_database import JsonStorageXDG
|
|
4
|
+
from typing import Union, Iterable, List, Optional
|
|
5
|
+
from json_database import JsonStorageXDG, EncryptedJsonStorageXD
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
|
|
8
8
|
|
|
@@ -11,9 +11,18 @@ class JsonDB(AbstractDB):
|
|
|
11
11
|
"""HiveMind Database implementation using JSON files."""
|
|
12
12
|
name: str = "clients"
|
|
13
13
|
subfolder: str = "hivemind-core"
|
|
14
|
+
password: Optional[str] = None
|
|
14
15
|
|
|
15
16
|
def __post_init__(self):
|
|
16
|
-
|
|
17
|
+
if self.password:
|
|
18
|
+
self._db = EncryptedJsonStorageXDG(encrypt_key=self.password,
|
|
19
|
+
name=self.name,
|
|
20
|
+
subfolder=self.subfolder,
|
|
21
|
+
xdg_folder=xdg_data_home())
|
|
22
|
+
else:
|
|
23
|
+
self._db = JsonStorageXDG(self.name,
|
|
24
|
+
subfolder=self.subfolder,
|
|
25
|
+
xdg_folder=xdg_data_home())
|
|
17
26
|
LOG.debug(f"json database path: {self._db.path}")
|
|
18
27
|
|
|
19
28
|
def sync(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|