""" This file contains all code for the queue mechanisms used for
communication inside the debugger.
"""

from Queue import Queue, Empty

class MQueue(Queue):
    """ This class represents a 'communcation' queue. """
    def __init__(self):
        Queue.__init__(self)

    def append(self, msg):
        """ This command simply calls this object's put method. This
        method allows us to immitate a list object.
        """
        self.put_nowait(msg)

    def pop(self, index=None):
        """ Immitate a list object so that we can use cmdloop from cmd.Cmd.
        Note: the 'index' argument is never used.
        """
        return self.get()




