git » git-arr » commit 47d5007

views/tree.html: Fix lambda syntax

author Alberto Bertogli
2014-07-28 22:33:43 UTC
committer Alberto Bertogli
2014-07-28 22:46:50 UTC
parent eb7cadd64faee9e654a9aee992d21d7bceb716ea

views/tree.html: Fix lambda syntax

Some versions of bottle.py don't deal well with the "if" inside the lambda, so
work around it by just using comparison and simplifying the function.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

views/tree.html +1 -1

diff --git a/views/tree.html b/views/tree.html
index aad7402..5edacb8 100644
--- a/views/tree.html
+++ b/views/tree.html
@@ -36,7 +36,7 @@
 </h3>
 
 <table class="nice ls">
-% key_func = lambda (t, n, s): (0 if t == 'tree' else 1, n.raw)
+% key_func = lambda (t, n, s): (t != 'tree', n.raw)
 % for type, name, size in sorted(tree.ls(dirname.raw), key = key_func):
     <tr class="{{type}}">
 %   if type == "blob":