]> git.phdru.name Git - bookmarks_db.git/commitdiff
Feat(check_urls): Cut long icons strings
authorOleg Broytman <phd@phdru.name>
Thu, 6 Mar 2025 14:39:41 +0000 (17:39 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 6 Mar 2025 14:39:41 +0000 (17:39 +0300)
check_urls.py

index 68e2d2a84f51fd771c1f5c24e3b453747b9666a6..491d306c510cb672baa332e394d603fa5a8fafb6 100755 (executable)
@@ -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,
               )
             )