From: Oleg Broytman Date: Thu, 6 Mar 2025 14:39:41 +0000 (+0300) Subject: Feat(check_urls): Cut long icons strings X-Git-Tag: 6.4.0~5 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=fb9bf883da601ef06847c441d6435a2a2fa9e2f1;p=bookmarks_db.git Feat(check_urls): Cut long icons strings --- diff --git a/check_urls.py b/check_urls.py index 68e2d2a..491d306 100755 --- a/check_urls.py +++ b/check_urls.py @@ -28,6 +28,13 @@ else: httplib.HTTP = MyHTTP +def cut_long_str(s): + if s: + if len(s) > 50: + return s[:50] + '...' + return s + + def run(): print("Broytman check_urls, Copyright (C) 2010-2024 PhiloSoft Design") @@ -82,7 +89,8 @@ def run(): strftime(bookmark.last_modified), getattr(bookmark, 'size', None), getattr(bookmark, 'md5', None), - bookmark.icon_href, bookmark.icon, bookmark.charset, + bookmark.icon_href, cut_long_str(bookmark.icon), + bookmark.charset, ) )