Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-04-29 13:54:07 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-04-29 13:54:07 (GMT)
commit950b823bcff7af29ade63b49602195edf93b6ca0 (patch)
tree7fc1e6037999e3362fee81fc96680be53d84898f
parentabd33b7c62dc7f9372c6d577ba480bf5726a4d1f (diff)
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 <gonzalo@laptop.org>
-rw-r--r--logviewer.py6
1 files changed, 6 insertions, 0 deletions
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: