Skip to content

Commit

Permalink
make critical fixes in replace plugin and Makefile
Browse files Browse the repository at this point in the history
- handle empty replace
- fix docker and sudo docker dichotomy
- bump ver
  • Loading branch information
aahnik committed Dec 11, 2022
1 parent b8da962 commit 5a63346
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ pypi:
@poetry publish --build

docker:
@sudo docker build -t tgcf .
@docker build -t tgcf .
@docker tag tgcf aahnik/tgcf:latest
@docker tag tgcf aahnik/tgcf:$(VERSION)

docker-release: docker
@docker push -a aahnik/tgcf

docker-run:
@docker run -d -p 8501:8501 --env-file .env aahnik/tgcf

release: pypi docker-release
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tgcf"
version = "1.1.4"
version = "1.1.6"
description = "The ultimate tool to automate custom telegram message forwarding."
authors = ["aahnik <[email protected]>"]
license = "MIT"
Expand Down
16 changes: 14 additions & 2 deletions tgcf/web_ui/pages/4_🔌_Plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,22 @@
CONFIG.plugins.replace.text_raw = st.text_area(
"Replacements", value=CONFIG.plugins.replace.text_raw
)
CONFIG.plugins.replace.text = yaml.safe_load(CONFIG.plugins.replace.text_raw)
replace_dict = yaml.safe_load(CONFIG.plugins.replace.text_raw)
if not replace_dict:
replace_dict = {}

CONFIG.plugins.replace.text = replace_dict

st.markdown(
"Replace one word or expression with another. Write every replacement in a new line. The original text then a colon `:` and then the new text. View [docs](https://github.com/aahnik/tgcf/wiki/Replace-Plugin) for advanced usage."
"""
Replace one word or expression with another.
- Write every replacement in a new line.
- The original text then **a colon `:`** and then **a space** and then the new text.
- Its recommended to use double quotes. Quotes are must when your string contain spaces or special characters.
```
"orginal": "new"
```
- View [docs](https://github.com/aahnik/tgcf/wiki/Replace-Plugin) for advanced usage."""
)

with st.expander("Caption"):
Expand Down

0 comments on commit 5a63346

Please sign in to comment.