class CustomerQueueFactory(protocol.Factory):
    def __init__(self):
        self.q = CustomerQueue()
        pass

    def add_to_queue(self, customer):
        self.q.add_customer(customer)

    def get_from_queue(self):
        return self.q.get_customer()

    def has_customer(self):
        return self.q.has_customer()

    def buildProtocol(self, addr):
        print "Got connection from "+str(addr)
        return CustomerQueueServer(self)
class CustomerQueueFactory(protocol.Factory):
    def __init__(self):
        self.q = CustomerQueue()
        pass

    def add_to_queue(self, customer):
        self.q.add_customer(customer)

    def get_from_queue(self):
        return self.q.get_customer()

    def has_customer(self):
        return self.q.has_customer()

    def buildProtocol(self, addr):
        print "Got connection from " + str(addr)
        return CustomerQueueServer(self)
 def __init__(self):
     self.q = CustomerQueue()
     pass
 def __init__(self):
     self.q = CustomerQueue()
     pass