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 14:13:29 (GMT)
commitc0446e3f7593fdbd71c33ddb044eb990a1df8bfb (patch)
treecf8bab37d55c80a758c9c7f974e8c5bcf7ae7c0c
parentff20e276c5bd5545e20e32128d394d121be11a7a (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: