From d1d64ab9548eba12dcb7f520d065e177f6feec0e Mon Sep 17 00:00:00 2001 From: mst Date: Sat, 28 Sep 2024 12:51:03 +0300 Subject: [PATCH] some fixes --- CHANGELOG.md | 6 ++++++ config.example.json | 1 + constants.py | 2 +- functions.py | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b24ba5..6bd5535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.5.5 + +### Fixes +* convert trim value to int +* update default config + ## 1.5.4 ### Fixes diff --git a/config.example.json b/config.example.json index 81f5a7d..3ae0428 100644 --- a/config.example.json +++ b/config.example.json @@ -15,6 +15,7 @@ "tintColors": false, "infoBoxLayout": "column" }, + "trimContentAfter": "50", "charLimit": "512", "anonName": "Anonymous", "lockInbox": false, diff --git a/constants.py b/constants.py index f3fb4e2..b171b5d 100644 --- a/constants.py +++ b/constants.py @@ -5,6 +5,6 @@ blacklistFile = 'word_blacklist.txt' configFile = 'config.json' faviconDir = Path.cwd() / 'static' / 'icons' / 'favicon' appName = 'CatAsk' -version = '1.5.4' +version = '1.5.5' # id (identifier) is to be interpreted as described in https://semver.org/#spec-item-9 version_id = '-alpha' diff --git a/functions.py b/functions.py index 8e5830f..2ca5bca 100644 --- a/functions.py +++ b/functions.py @@ -100,7 +100,8 @@ def getRandomWord(): return random.choice(items) def trimContent(var, trim): - if int(trim) > 0: + trim = int(trim) + if trim > 0: trimmed = var[:trim] + '…' if len(var) >= trim else var trimmed = trimmed.rstrip() return trimmed