# Path: Qt.py

# 
# Path: ts2/utils.py
# class Context:
# class FormatException(Exception):
# class MissingDependencyException(Exception):
# class DurationProba(QtCore.QObject):
#     GAME = 10
#     EDITORS = [20, 21, 22, 23, 24, 25]
#     EDITOR_GENERAL = 20
#     EDITOR_SCENERY = 21
#     EDITOR_ROUTES = 22
#     EDITOR_TRAINTYPES = 23
#     EDITOR_SERVICES = 24
#     EDITOR_TRAINS = 25
#     def __init__(self, arg):
#     def __init__(self, arg):
# def cumsum(lis):
#     def __init__(self, data):
#     def __str__(self):
#     def list(self):
#     def isNull(self):
#     def yieldValue(self):
# def to_json(data):
# def from_json(json_str):


from Qt import QtCore, QtGui, Qt
from ts2 import utils
    """A Message instance holds all the data regarding one message emitted to
    the Message Logger of the simulation."""

    SOFTWARE_MSG = 0
    PLAYER_WARNING_MSG = 1
    SIMULATION_MSG = 2

    def __init__(self, parameters):
        """Constructor for the Message class.
        :param parameters: dictionary to build the message. Should have a
        'msgType' and a 'msgText' keys.
        :type parameters: dict
        """
        super().__init__()
        self.msgType = parameters['msgType']
        self.msgText = parameters['msgText']

    def __str__(self):
        """Returns the string representation of the message."""
        return self.msgText

    def for_json(self):
        """Dumps this message to JSON."""
        return {
            "__type__": "Message",
            "msgType": self.msgType,
            "msgText": self.msgText
        }



# Path: Qt.py

# 
# Path: ts2/utils.py
# class Context:
# class FormatException(Exception):
# class MissingDependencyException(Exception):
# class DurationProba(QtCore.QObject):
#     GAME = 10
#     EDITORS = [20, 21, 22, 23, 24, 25]
#     EDITOR_GENERAL = 20
#     EDITOR_SCENERY = 21
#     EDITOR_ROUTES = 22
#     EDITOR_TRAINTYPES = 23
#     EDITOR_SERVICES = 24
#     EDITOR_TRAINS = 25
#     def __init__(self, arg):
#     def __init__(self, arg):
# def cumsum(lis):
#     def __init__(self, data):
#     def __str__(self):
#     def list(self):
#     def isNull(self):
#     def yieldValue(self):
# def to_json(data):
# def from_json(json_str):


# Path: ts2/game/logger.py
from Qt import QtCore, QtGui, Qt
from ts2 import utils

    """A Message instance holds all the data regarding one message emitted to
    the Message Logger of the simulation."""

    SOFTWARE_MSG = 0
    PLAYER_WARNING_MSG = 1
    SIMULATION_MSG = 2

    def __init__(self, parameters):
        """Constructor for the Message class.
        :param parameters: dictionary to build the message. Should have a
        'msgType' and a 'msgText' keys.
        :type parameters: dict
        """
        super().__init__()
        self.msgType = parameters['msgType']
        self.msgText = parameters['msgText']

    def __str__(self):
        """Returns the string representation of the message."""
        return self.msgText

    def for_json(self):
        """Dumps this message to JSON."""
        return {
            "__type__": "Message",
            "msgType": self.msgType,
            "msgText": self.msgText
        }



class MessageLogger(QtCore.QAbstractTableModel):