# HG changeset patch # User Paul Boddie # Date 1425933218 -3600 # Node ID 375fcc24a0c07a589c9221c60475a2b5f73dd025 # Parent 76da4db72130afd533bf667b9df9ac3ba33738a1 Use a slightly nicer way of building CSS class attributes. diff -r 76da4db72130 -r 375fcc24a0c0 imip_manager.py --- a/imip_manager.py Mon Mar 09 18:30:38 2015 +0100 +++ b/imip_manager.py Mon Mar 09 21:33:38 2015 +0100 @@ -1670,11 +1670,11 @@ have_active = reduce(lambda x, y: x or y, [slots and slots.get(point) for slots in groups], None) - css = " ".join( - ["slot"] + - (have_active and ["busy"] or ["empty"]) + - (continuation and ["daystart"] or []) - ) + css = " ".join([ + "slot", + have_active and "busy" or "empty", + continuation and "daystart" or "" + ]) page.tr(class_=css) page.th(class_="timeslot") @@ -1727,12 +1727,12 @@ will_continue = not ends_on_same_day(point, end, tzid) is_organiser = organiser == self.user - css = " ".join( - ["event"] + - (has_continued and ["continued"] or []) + - (will_continue and ["continues"] or []) + - (is_organiser and ["organising"] or ["attending"]) - ) + css = " ".join([ + "event", + has_continued and "continued" or "", + will_continue and "continues" or "", + is_organiser and "organising" or "attending" + ]) # Only anchor the first cell of events. # NOTE: Need to only anchor the first period for a