geändert: README.md

geändert:       pyproject.toml
	geändert:       src/jeb_utils/jeb_utils.py
This commit is contained in:
2026-02-19 18:18:51 +01:00
parent 72de06e531
commit 24a0850f55
3 changed files with 5 additions and 2 deletions
+3
View File
@@ -77,6 +77,9 @@ pip install jeb-utils --index-url https://jcloud-services.ddns.net/simple/ --ext
- `create_file_if_not_exists`: Creates a file if it does not exist. - `create_file_if_not_exists`: Creates a file if it does not exist.
## Changelog ## Changelog
### Version 0.1.2
- Bug fix: `jeb_utils.mktopicpart` tried to raise `jeb_utils.exceptions.exceptions.TopicNotFoundError` instead of `jeb_utils.exceptions.TopicNotFoundError` if the topic does not exist.
### Version 0.1.1 ### Version 0.1.1
- Support for custom data paths (`jeb_utils.init`) - Support for custom data paths (`jeb_utils.init`)
+1 -1
View File
@@ -4,6 +4,6 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "jeb-utils" name = "jeb-utils"
version = "0.1.1" version = "0.1.2"
description = "Common utils for JEB client and server." description = "Common utils for JEB client and server."
dependencies = ["cryptography"] dependencies = ["cryptography"]
+1 -1
View File
@@ -127,7 +127,7 @@ def mktopicpart(topic_name: str, partition_number: int):
formatted_partition_number = f'{(int(partition_number)):02d}' formatted_partition_number = f'{(int(partition_number)):02d}'
with dbm.open(f'{DATA_DIR}/conf/topics', 'c') as db: with dbm.open(f'{DATA_DIR}/conf/topics', 'c') as db:
if topic_name.encode() not in db.keys(): if topic_name.encode() not in db.keys():
raise exceptions.exceptions.TopicNotFoundError(f'topic \'{topic_name}\' does not exist') raise exceptions.TopicNotFoundError(f'topic \'{topic_name}\' does not exist')
partitions = pickle.loads(db[topic_name.encode()])['partitions'] partitions = pickle.loads(db[topic_name.encode()])['partitions']
if partition_number in partitions: if partition_number in partitions:
raise exceptions.TopicPartitionExistsError(f'partition \'{formatted_partition_number}\' already exists for topic \'{topic_name}\'') raise exceptions.TopicPartitionExistsError(f'partition \'{formatted_partition_number}\' already exists for topic \'{topic_name}\'')