Module: check_mk
Branch: master
Commit: e136cefc54789cc7b454ab9614104d72254d4b7d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e136cefc54789c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 25 10:15:59 2011 +0200
FIX: Removed new python syntax which is incompatible with old python versions
---
ChangeLog | 1 +
web/htdocs/views.py | 11 +++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1a9b88e..4d18dd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Multisite:
* FIX: WATO filtered status GUIs did not update the title after changing
the title of the file/folder in WATO
+ * FIX: Removed new python syntax which is incompatible with old python versions
1.1.11i3:
Core, Setup, etc.:
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 56efde2..f4153f5 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1162,7 +1162,10 @@ def show_view(view, show_heading = False, show_buttons = True,
show_footer = Tru
query = filterheaders + view.get("add_headers", "")
# [4] Sorting - use view sorters or url supplied sorters
- sorter_list = parse_url_sorters(html.var('sort')) if
html.has_var('sort') else view["sorters"]
+ if html.has_var('sort'):
+ sorter_list = parse_url_sorters(html.var('sort'))
+ else:
+ sorter_list = view["sorters"]
sorters = [ (multisite_sorters[sn], reverse) for sn, reverse in sorter_list ]
# [5] Grouping
@@ -2297,7 +2300,7 @@ def sort_url(view, painter):
# Now add the sorter as primary user sorter
sorter = group_sort + [this_asc_sorter] + user_sort + view_sort
- return ','.join([ ('-' if s[1] else '') + s[0] for s in
sorter ])
+ return ','.join([ (s[1] and '-' or '') + s[0] for s in sorter
])
def paint_header(view, p):
painter = p[0]
@@ -2400,8 +2403,8 @@ def declare_1to1_sorter(painter_name, func, col_num = 0, reverse =
False):
"title" : multisite_painters[painter_name]['title'],
"columns" : multisite_painters[painter_name]['columns'],
"cmp" : lambda r1, r2:
func(multisite_painters[painter_name]['columns'][col_num],
- r1 if reverse else r2,
- r2 if reverse else r1)
+ reverse and r1 or r2,
+ reverse and r2 or r1)
}
return painter_name