nodes: 0, module; 1, function_definition; 2, function_name:_print_message; 3, parameters; 4, block; 5, identifier:self; 6, identifier:prefix; 7, identifier:message; 8, default_parameter; 9, expression_statement; 10, comment:# Load up the standard output.; 11, expression_statement; 12, comment:# We have some extra stuff for verbose mode.; 13, if_statement; 14, comment:# Send the final output to the handler to be rendered.; 15, expression_statement; 16, identifier:verbose; 17, True; 18, string; 19, assignment; 20, identifier:verbose; 21, block; 22, call; 23, string_content:Prints a message and takes care of all sorts of nasty code; 24, identifier:output; 25, list; 26, expression_statement; 27, comment:# Detailed problem description.; 28, if_statement; 29, if_statement; 30, if_statement; 31, comment:# Show the user what tier we're on; 32, expression_statement; 33, comment:# If file information is available, output that as well.; 34, expression_statement; 35, if_statement; 36, comment:# If there is a line number, that gets put on the end.; 37, if_statement; 38, if_statement; 39, if_statement; 40, comment:# Stick it in with the standard items.; 41, expression_statement; 42, expression_statement; 43, attribute; 44, argument_list; 45, string; 46, identifier:prefix; 47, subscript; 48, assignment; 49, subscript; 50, block; 51, call; 52, block; 53, call; 54, block; 55, call; 56, assignment; 57, boolean_operator; 58, block; 59, subscript; 60, block; 61, boolean_operator; 62, block; 63, call; 64, block; 65, call; 66, call; 67, attribute; 68, identifier:write; 69, call; 70, string_content; 71, identifier:message; 72, string; 73, identifier:verbose_output; 74, list; 75, identifier:message; 76, string; 77, expression_statement; 78, attribute; 79, argument_list; 80, expression_statement; 81, attribute; 82, argument_list; 83, expression_statement; 84, expression_statement; 85, attribute; 86, argument_list; 87, identifier:files; 88, subscript; 89, comparison_operator:files is not None; 90, comparison_operator:files != ''; 91, expression_statement; 92, comment:# Nested files (subpackes) are stored in a list.; 93, if_statement; 94, identifier:message; 95, string; 96, expression_statement; 97, subscript; 98, comparison_operator:message['column'] != 0; 99, expression_statement; 100, attribute; 101, argument_list; 102, expression_statement; 103, expression_statement; 104, attribute; 105, argument_list; 106, attribute; 107, argument_list; 108, identifier:self; 109, identifier:handler; 110, attribute; 111, argument_list; 112, escape_sequence:\n; 113, string_content:message; 114, string_content:description; 115, call; 116, identifier:message; 117, identifier:get; 118, string; 119, call; 120, identifier:message; 121, identifier:get; 122, string; 123, call; 124, call; 125, identifier:verbose_output; 126, identifier:append; 127, binary_operator:'\tTier:\t%d' % message['tier']; 128, identifier:message; 129, string; 130, identifier:files; 131, None; 132, identifier:files; 133, string; 134, assignment; 135, comparison_operator:type(files) is list; 136, block; 137, else_clause; 138, string_content:line; 139, call; 140, identifier:message; 141, string; 142, subscript; 143, integer:0; 144, call; 145, identifier:message; 146, identifier:get; 147, string; 148, call; 149, call; 150, identifier:output; 151, identifier:append; 152, string; 153, identifier:output; 154, identifier:append; 155, call; 156, string; 157, identifier:join; 158, call; 159, attribute; 160, argument_list; 161, string_content:signing_severity; 162, attribute; 163, argument_list; 164, string_content:signing_help; 165, attribute; 166, argument_list; 167, attribute; 168, argument_list; 169, string; 170, subscript; 171, string_content:file; 172, identifier:fmsg; 173, string; 174, call; 175, identifier:list; 176, if_statement; 177, expression_statement; 178, block; 179, attribute; 180, argument_list; 181, string_content:column; 182, identifier:message; 183, string; 184, attribute; 185, argument_list; 186, string_content:context; 187, attribute; 188, argument_list; 189, attribute; 190, argument_list; 191, string_content; 192, attribute; 193, argument_list; 194, identifier:map; 195, argument_list; 196, identifier:verbose_output; 197, identifier:append; 198, call; 199, identifier:verbose_output; 200, identifier:append; 201, parenthesized_expression; 202, identifier:verbose_output; 203, identifier:append; 204, string; 205, identifier:verbose_output; 206, identifier:append; 207, call; 208, string_content; 209, identifier:message; 210, string; 211, string_content; 212, identifier:type; 213, argument_list; 214, comparison_operator:files[-1] == ''; 215, block; 216, call; 217, expression_statement; 218, identifier:verbose_output; 219, identifier:append; 220, binary_operator:'\tLine:\t%s' % message['line']; 221, string_content:column; 222, identifier:verbose_output; 223, identifier:append; 224, binary_operator:'\tColumn:\t%d' % message['column']; 225, identifier:verbose_output; 226, identifier:append; 227, string; 228, identifier:verbose_output; 229, identifier:extend; 230, list_comprehension; 231, escape_sequence:\n; 232, string; 233, identifier:join; 234, identifier:verbose_output; 235, attribute; 236, identifier:output; 237, attribute; 238, argument_list; 239, binary_operator:'\tAutomated signing severity: %s' %
                       message['signing_severity']; 240, string_content; 241, attribute; 242, argument_list; 243, escape_sequence:\t; 244, escape_sequence:\t; 245, string_content:tier; 246, escape_sequence:\t; 247, escape_sequence:\t; 248, identifier:files; 249, subscript; 250, string; 251, expression_statement; 252, attribute; 253, argument_list; 254, call; 255, string; 256, subscript; 257, string; 258, subscript; 259, string_content; 260, parenthesized_expression; 261, for_in_clause; 262, string_content; 263, identifier:unicodehelper; 264, identifier:decode; 265, identifier:self; 266, identifier:_flatten_list; 267, subscript; 268, string; 269, subscript; 270, escape_sequence:\t; 271, identifier:self; 272, identifier:_flatten_list; 273, subscript; 274, identifier:files; 275, unary_operator; 276, assignment; 277, identifier:verbose_output; 278, identifier:append; 279, binary_operator:fmsg % ' > '.join(files); 280, attribute; 281, argument_list; 282, string_content; 283, identifier:message; 284, string; 285, string_content; 286, identifier:message; 287, string; 288, escape_sequence:\t; 289, conditional_expression:'\t> %s' % x
                                          if x is not None
                                          else '\t>' + ('-' * 20); 290, identifier:x; 291, subscript; 292, escape_sequence:\n; 293, identifier:message; 294, string; 295, string_content; 296, identifier:message; 297, string; 298, identifier:message; 299, string; 300, integer:1; 301, subscript; 302, string; 303, identifier:fmsg; 304, call; 305, identifier:verbose_output; 306, identifier:append; 307, binary_operator:fmsg % files; 308, escape_sequence:\t; 309, escape_sequence:\t; 310, string_content:line; 311, escape_sequence:\t; 312, escape_sequence:\t; 313, string_content:column; 314, binary_operator:'\t> %s' % x; 315, comparison_operator:x is not None; 316, binary_operator:'\t>' + ('-' * 20); 317, identifier:message; 318, string; 319, string_content:description; 320, escape_sequence:\t; 321, string_content:signing_severity; 322, string_content:signing_help; 323, identifier:files; 324, unary_operator; 325, string_content:(none); 326, attribute; 327, argument_list; 328, identifier:fmsg; 329, identifier:files; 330, string; 331, identifier:x; 332, identifier:x; 333, None; 334, string; 335, parenthesized_expression; 336, string_content:context; 337, integer:1; 338, string; 339, identifier:join; 340, identifier:files; 341, string_content; 342, string_content; 343, binary_operator:'-' * 20; 344, string_content:>; 345, escape_sequence:\t; 346, escape_sequence:\t; 347, string; 348, integer:20; 349, string_content:-
code: def _print_message(self, prefix, message, verbose=True):
          'Prints a message and takes care of all sorts of nasty code'
  
          # Load up the standard output.
          output = ['\n', prefix, message['message']]
  
          # We have some extra stuff for verbose mode.
          if verbose:
              verbose_output = []
  
              # Detailed problem description.
              if message['description']:
                  verbose_output.append(
                      self._flatten_list(message['description']))
  
              if message.get('signing_severity'):
                  verbose_output.append(
                      ('\tAutomated signing severity: %s' %
                       message['signing_severity']))
  
              if message.get('signing_help'):
                  verbose_output.append(
                      '\tSuggestions for passing automated signing:')
                  verbose_output.append(
                      self._flatten_list(message['signing_help']))
  
              # Show the user what tier we're on
              verbose_output.append('\tTier:\t%d' % message['tier'])
  
              # If file information is available, output that as well.
              files = message['file']
              if files is not None and files != '':
                  fmsg = '\tFile:\t%s'
  
                  # Nested files (subpackes) are stored in a list.
                  if type(files) is list:
                      if files[-1] == '':
                          files[-1] = '(none)'
                      verbose_output.append(fmsg % ' > '.join(files))
                  else:
                      verbose_output.append(fmsg % files)
  
              # If there is a line number, that gets put on the end.
              if message['line']:
                  verbose_output.append('\tLine:\t%s' % message['line'])
              if message['column'] and message['column'] != 0:
                  verbose_output.append('\tColumn:\t%d' % message['column'])
  
              if message.get('context'):
                  verbose_output.append('\tContext:')
                  verbose_output.extend([('\t> %s' % x
                                          if x is not None
                                          else '\t>' + ('-' * 20))
                                         for x
                                         in message['context']])
  
              # Stick it in with the standard items.
              output.append('\n')
              output.append('\n'.join(verbose_output))
  
          # Send the final output to the handler to be rendered.
          self.handler.write(u''.join(map(unicodehelper.decode, output)))