# Path: validator/unicodehelper.py
# UNICODE_BOMS = [
#     (codecs.BOM_UTF8, 'utf-8'),
#     (codecs.BOM_UTF32_LE, 'utf-32-le'),
#     (codecs.BOM_UTF32_BE, 'utf-32-be'),
#     (codecs.BOM_UTF16_LE, 'utf-16-le'),
#     (codecs.BOM_UTF16_BE, 'utf-16-be'),
# ]
# COMMON_ENCODINGS = ('latin_1', 'utf-16')
# NON_ASCII_FILTER = re.compile(r'[^\t\r\n\x20-\x7f]+')
# def decode(data):


import json
import logging
import types
import uuid
import validator
from StringIO import StringIO
from validator import unicodehelper
from validator.constants import SIGNING_SEVERITIES
from validator.outputhandlers.shellcolors import OutputHandler
            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.

# Path: validator/unicodehelper.py
# UNICODE_BOMS = [
#     (codecs.BOM_UTF8, 'utf-8'),
#     (codecs.BOM_UTF32_LE, 'utf-32-le'),
#     (codecs.BOM_UTF32_BE, 'utf-32-be'),
#     (codecs.BOM_UTF16_LE, 'utf-16-le'),
#     (codecs.BOM_UTF16_BE, 'utf-16-be'),
# ]
# COMMON_ENCODINGS = ('latin_1', 'utf-16')
# NON_ASCII_FILTER = re.compile(r'[^\t\r\n\x20-\x7f]+')
# def decode(data):


# Path: validator/errorbundler.py
import json
import logging
import types
import uuid
import validator
from StringIO import StringIO
from validator import unicodehelper
from validator.constants import SIGNING_SEVERITIES
from validator.outputhandlers.shellcolors import OutputHandler

            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)))