diff --git a/CHANGELOG.md b/CHANGELOG.md index ad0b05d..f24b743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## v1.0.3 - 2024-01-29 +### What's Changed +**full changelog**: https://github.com/obervinov/messages-package/compare/v1.0.2...v1.0.3 by @ obervinov https://github.com/obervinov/messages-package/pull/ +#### 🐛 Bug Fixes +* [Fix typos in README.md](https://github.com/obervinov/messages-package/issues/20) + + ## v1.0.2 - 2024-01-24 ### What's Changed **full changelog**: https://github.com/obervinov/messages-package/compare/v1.0.1...v1.0.2 by @ obervinov https://github.com/obervinov/messages-package/pull/19 diff --git a/README.md b/README.md index cc3d5a9..2829791 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This package helps to easily and quickly generate beautiful messages for telegra ## Environment variables | Variable | Description | Default value | | ------------- | ------------- | ------------- | -| `MESSAGES_CONFIG` | Json file with templates for rendering messages. (Example)[tests/configs/messages.json] | `configs/messages.json` | +| `MESSAGES_CONFIG` | Json file with templates for rendering messages. [Example](tests/configs/messages.json) | `configs/messages.json` | ## Installing with Poetry @@ -38,7 +38,7 @@ version = "1.0.0" [tool.poetry.dependencies] python = "^3.10" -messages = { git = "https://github.com/obervinov/messages-package.git", tag = "v1.0.1" } +messages = { git = "https://github.com/obervinov/messages-package.git", tag = "v1.0.3" } [build-system] requires = ["poetry-core"] @@ -54,7 +54,14 @@ poetry install - all emojis should be wrapped in `:` - all variables must be specified in the same form as in your code ```json -{ "templates": {"hello_message": {"text": "Hi, {0}! {1}\nAccess for your account - allowed {2}", "args": ["username", ":raised_hand:", ":unlocked:"]}}} +{ + "templates": { + "hello_message": { + "text": "Hi, {0}! {1}\nAccess for your account - allowed {2}", + "args": ["username", ":raised_hand:", ":unlocked:"] + } + } +} ``` ```python @@ -84,7 +91,14 @@ Access for your account - allowed 🔓 - all emojis should be wrapped in `:` - all variables must be specified in the same form as in your code ```json -{"templates": {"progressbar_message": {"text": "{0} Messages from the queue have already been processed", "args": [":framed_picture:", "progressbar"]}} +{ + "templates": { + "queue_message": { + "text": "{0} Messages from the queue have already been processed\n{1}", + "args": [":framed_picture:", "progressbar"] + } + } +} ``` ```python @@ -94,16 +108,20 @@ from messages import Messages # Create instance messages = Messages() -# Rendering and getting messages +# Render and get messages with progress bar print( - messages.render_progressbar( - total_count=100, - current_count=19 + messages.render_template( + template_alias='queue_message', + progressbar=messages.render_progressbar( + total_count=100, + current_count=19 + ) ) ) ``` _output result_ ```python -[◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️]19%🔓 +🏞 Messages from the queue have already been processed +[◾◾◾◾◾◾◾◾◾◾◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️]19% ``` diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index 1dfa98f..0000000 --- a/poetry.lock +++ /dev/null @@ -1,20 +0,0 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. - -[[package]] -name = "emoji" -version = "2.10.0" -description = "Emoji for Python" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "emoji-2.10.0-py2.py3-none-any.whl", hash = "sha256:aed4332caa23553a7218f032c08b0a325ae53b010f7fb98ad272c0f7841bc1d3"}, - {file = "emoji-2.10.0.tar.gz", hash = "sha256:7e68435eecd2c428c3b4aaa5f72d61a5b1a36c81a5138681cba13d19d94aa3a0"}, -] - -[package.extras] -dev = ["coverage", "coveralls", "pytest"] - -[metadata] -lock-version = "2.0" -python-versions = "^3.10" -content-hash = "05357ba44a60f04fe616d16fc37dd629871a07bc98b67de8ae0eed42f0a0e5c8" diff --git a/pyproject.toml b/pyproject.toml index 464be6a..c0f4711 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "messages" -version = "1.0.2" +version = "1.0.3" description = "This package helps to easily and quickly generate beautiful messages for telegram bots using templates described in json." authors = ["Bervinov Oleg "] maintainers = ["Bervinov Oleg "] @@ -18,7 +18,7 @@ include = ["CHANGELOG.md"] [tool.poetry.dependencies] python = "^3.10" -emoji = "^2.10.0" +emoji = "^2" [build-system] requires = ["poetry-core"]