from Queue import Queue, Empty
import logging

class MessageQueue(Queue):
    def __init__(self):
        Queue.__init__(self)

    def get(self):
        try:
            return Queue.get(self, False)
        except Empty:
            return ""

    def clear(self):
        try:
            while Queue.get(self, False): pass
        except Empty:
            pass
        

        
mainMessageQueue = MessageQueue()
progressMessageQueue = MessageQueue()
freshmeatMessageQueue = MessageQueue()
ftpProgressQueue = MessageQueue()
