#NEWLINE# @ utils . arg ( 'id' , metavar = '<NOTIFICATION_ID>' , help = 'The ID of the notification. If not specified returns all.' ) #NEWLINE# def do_notification_show( mc , args ) : #NEWLINE# #INDENT# 'Describe the notification.' #NEWLINE# fields = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# fields [ 'notification_id' ] = args . id #NEWLINE# try : #NEWLINE# #INDENT# notification = mc . notifications . get ( ** fields ) #NEWLINE# #UNINDENT# except exc . HTTPException as he : #NEWLINE# #INDENT# raise exc . CommandError ( ( 'HTTPException code=%s message=%s' % ( he . code , he . message ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if args . json : #NEWLINE# #INDENT# print ( utils . json_formatter ( notification ) ) #NEWLINE# return #NEWLINE# #UNINDENT# formatters = { #NEWLINE# #INDENT# 'name' : utils . json_formatter , #NEWLINE# 'id' : utils . json_formatter , #NEWLINE# 'type' : utils . json_formatter , #NEWLINE# 'address' : utils . json_formatter , #NEWLINE# 'links' : utils . format_dictlist , #NEWLINE# #UNINDENT# } #NEWLINE# utils . print_dict ( notification , formatters = formatters )