diff cutils/treesum.py @ 303:73d13be531b5

treesum: in the "info" command print a sortes list of errors
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 05 Mar 2025 10:22:29 +0100
parents bf88323d6bf7
children ebddfdbc3f7a
line wrap: on
line diff
--- a/cutils/treesum.py	Wed Mar 05 10:07:44 2025 +0100
+++ b/cutils/treesum.py	Wed Mar 05 10:22:29 2025 +0100
@@ -1622,7 +1622,16 @@
     if algorithm != "SIZE":
         print("    Digest:", digeststr)
     print("    Size:", sizestr)
-    print("    Errors:", errors if errors else "<none>")
+    if errors:
+        errorlist = list(errors)
+        errorlist.sort()
+        for idx, err in enumerate(errorlist):
+            if idx == 0:
+                print("    Errors:", err)
+            else:
+                print("           ", err)
+    else:
+        print("    Errors: <none>")
 
 
 if __name__ == "__main__":