Skip to content

Commit

Permalink
Merge pull request #12 from TigreGotico/release-0.10.0a1
Browse files Browse the repository at this point in the history
Release 0.10.0a1
  • Loading branch information
JarbasAl authored Dec 29, 2024
2 parents 822d455 + b028d11 commit f357f8b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changelog

## [0.9.1a1](https://github.com/TigreGotico/json_database/tree/0.9.1a1) (2024-12-29)
## [0.10.0a1](https://github.com/TigreGotico/json_database/tree/0.10.0a1) (2024-12-29)

[Full Changelog](https://github.com/TigreGotico/json_database/compare/0.9.0...0.9.1a1)
[Full Changelog](https://github.com/TigreGotico/json_database/compare/0.9.1...0.10.0a1)

**Merged pull requests:**

- fix: add hivemind entrypoint to setup.py [\#9](https://github.com/TigreGotico/json_database/pull/9) ([JarbasAl](https://github.com/JarbasAl))
- feat: hpm encrypted db [\#11](https://github.com/TigreGotico/json_database/pull/11) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
15 changes: 12 additions & 3 deletions json_database/hpm.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from hivemind_plugin_manager.database import Client, AbstractDB, cast2client
from ovos_utils.log import LOG
from ovos_utils.xdg_utils import xdg_data_home
from typing import Union, Iterable, List
from json_database import JsonStorageXDG
from typing import Union, Iterable, List, Optional
from json_database import JsonStorageXDG, EncryptedJsonStorageXD
from dataclasses import dataclass


Expand All @@ -11,9 +11,18 @@ class JsonDB(AbstractDB):
"""HiveMind Database implementation using JSON files."""
name: str = "clients"
subfolder: str = "hivemind-core"
password: Optional[str] = None

def __post_init__(self):
self._db = JsonStorageXDG(self.name, subfolder=self.subfolder, xdg_folder=xdg_data_home())
if self.password:
self._db = EncryptedJsonStorageXDG(encrypt_key=self.password,
name=self.name,
subfolder=self.subfolder,
xdg_folder=xdg_data_home())
else:
self._db = JsonStorageXDG(self.name,
subfolder=self.subfolder,
xdg_folder=xdg_data_home())
LOG.debug(f"json database path: {self._db.path}")

def sync(self):
Expand Down
6 changes: 3 additions & 3 deletions json_database/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 9
VERSION_BUILD = 1
VERSION_ALPHA = 0
VERSION_MINOR = 10
VERSION_BUILD = 0
VERSION_ALPHA = 1
# END_VERSION_BLOCK

0 comments on commit f357f8b

Please sign in to comment.