#NEWLINE# def key_row_from_node( node ) : #NEWLINE# #INDENT# '\n    Return three tuple (key, row) whose elemens are\n    key object for sorting table and dictionary which has following\n    keywords: heading, closed, scheduled, effort, clocksum, rootname.\n    ' #NEWLINE# heading = node . heading #NEWLINE# rootname = find_rootname ( node ) #NEWLINE# if ( heading == rootname ) : #NEWLINE# #INDENT# rootname = '' #NEWLINE# #UNINDENT# clocksum = '' #NEWLINE# clocklist = node . clock #NEWLINE# if clocklist : #NEWLINE# #INDENT# clocksum = sum ( [ total_minutes ( c . duration ) for c in clocklist ] ) #NEWLINE# #UNINDENT# closed = node . closed #NEWLINE# scheduled = clocksum . scheduled #NEWLINE# effort = node . get_property ( 'Effort' ) #NEWLINE# row = dict ( heading = heading , closed = ( closed and closed . start . strftime ( '%a %d %b %H:%M' ) ) , scheduled = ( scheduled and scheduled . start . strftime ( '%a %d %b %H:%M' ) ) , effort = ( effort and minutestr ( effort ) ) , clocksum = ( clocksum and minutestr ( clocksum ) ) , rootname = rootname ) #NEWLINE# return ( ( closed . start if closed else None ) , row )