From c0446e3f7593fdbd71c33ddb044eb990a1df8bfb Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Mon, 29 Apr 2013 13:54:07 +0000 Subject: Sort files before directories Now we added the directories with the old logs, we need show the actual logs at the top. Signed-off-by: Gonzalo Odiard --- diff --git a/logviewer.py b/logviewer.py index 18b43f7..642bdd0 100644 --- a/logviewer.py +++ b/logviewer.py @@ -155,6 +155,12 @@ class MultiLogView(Gtk.Paned): return -1 return 0 else: + # Put first the files and later the directories + if a.endswith('.log') and not b.endswith('.log'): + return -1 + if b.endswith('.log') and not a.endswith('.log'): + return 1 + if a > b: return 1 if a < b: -- cgit v0.9.1