#NEWLINE# def format( execution = None , lister = False ) : #NEWLINE# #INDENT# columns = ( 'ID' , 'Workflow ID' , 'Workflow name' , 'Description' , 'Task Execution ID' , 'State' , 'State info' , 'Created at' , 'Updated at' ) #NEWLINE# if execution : #NEWLINE# #INDENT# state_info = ( execution . state_info if ( not lister ) else base . cut ( execution . state_info ) ) #NEWLINE# data = ( execution . id , execution . workflow_id , execution . workflow_name , execution . description , ( execution . task_execution_id or '<none>' ) , execution . state , state_info , execution . created_at , ( execution . updated_at or '<none>' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# data = ( tuple ( ( '<none>' for _ in range ( len ( columns ) ) ) ) , ) #NEWLINE# #UNINDENT# return ( columns , data )