From 8d402a2a4c7b3cb79bbb34d96d17d6be039899b3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 May 2010 09:01:03 -0600 Subject: [PATCH] Move comments to bottom of field list --- src/calibre/gui2/custom_column_widgets.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/custom_column_widgets.py b/src/calibre/gui2/custom_column_widgets.py index e366dbb7f2..0e4cf12e4c 100644 --- a/src/calibre/gui2/custom_column_widgets.py +++ b/src/calibre/gui2/custom_column_widgets.py @@ -240,7 +240,13 @@ widgets = { def populate_single_metadata_page(left, right, db, book_id, parent=None): x = db.custom_column_num_map cols = list(x) - cols.sort(cmp=lambda z,y: cmp(x[z]['name'].lower(), x[y]['name'].lower())) + def field_sort(y, z): + m1, m2 = x[y], x[z] + n1 = 'zzzzz' if m1['datatype'] == 'comments' else m1['name'] + n2 = 'zzzzz' if m2['datatype'] == 'comments' else m2['name'] + return cmp(n1.lower(), n2.lower()) + + cols.sort(cmp=field_sort) ans = [] for i, col in enumerate(cols): w = widgets[x[col]['datatype']](db, col, parent)