def from_data(cls, data):
        """Create a list of Messages from deserialized epubcheck json output.

        :param dict data: Decoded epubcheck json data
        :return list[Message]: List of messages
        """
        messages = []
        filename = data['checker']['filename']
        for m in data['messages']:
            for l in m['locations']:
                location = l['path']
                if not location.startswith(filename):
                    location = filename + '/' + location
                if l['line'] != -1:
                    location += ':{}'.format(l['line'])
                if l['column'] != -1:
                    location += ':{}'.format(l['column'])
                messages.append(
                    cls(m['ID'], m['severity'], location, m['message'], m['suggestion'])
                )
        return messages
def from_data ( cls , data ) : messages = [ ] filename = data [ 'checker' ] [ 'filename' ] for m in data [ 'messages' ] : for l in m [ 'locations' ] : location = l [ 'path' ] if not location . startswith ( filename ) : location = filename + '/' + location if l [ 'line' ] != - 1 : location += ':{}' . format ( l [ 'line' ] ) if l [ 'column' ] != - 1 : location += ':{}' . format ( l [ 'column' ] ) messages . append ( cls ( m [ 'ID' ] , m [ 'severity' ] , location , m [ 'message' ] , m [ 'suggestion' ] ) ) return messages
Create a list of Messages from deserialized epubcheck json output.

        :param dict data: Decoded epubcheck json data
        :return list[Message]: List of messages