Ejemplo n.º 1
0
 def addMessage(self, message, orderNumber):
     # We retrieve the order (if it exists)
     order = self.getOrderByValue(orderNumber)
     # if it doesn't exist we create it
     if order is None:
         order = Order(orderNumber)
         self.orders.append(order)
     order.addMessage(message)
Ejemplo n.º 2
0
 def addMessage(self, message, orderNumber):
     # We retrieve the order (if it exists)
     order = self.getOrderByValue(orderNumber)
     # if it doesn't exist we create it
     if order is None:
         order = Order(orderNumber)
         self.orders.append(order)
     order.addMessage(message)
Ejemplo n.º 3
0
    def loadFromXML(xmlRoot, vocabulary, namespace, version):
        if version == "0.1":
            sequence_ID = str(xmlRoot.get("id"))
            sequence_name = xmlRoot.get("name")
            sequence_description = xmlRoot.get("description")

            sequence = Sequence(sequence_ID, sequence_name, sequence_description)

            for xmlOrder in xmlRoot.findall("{" + namespace + "}order"):
                order = Order.loadFromXML(xmlOrder, vocabulary, namespace, version)
                sequence.addOrder(order)

            return sequence

        return None
Ejemplo n.º 4
0
    def loadFromXML(xmlRoot, vocabulary, namespace, version):
        if version == "0.1":
            sequence_ID = str(xmlRoot.get("id"))
            sequence_name = xmlRoot.get("name")
            sequence_description = xmlRoot.get("description")

            sequence = Sequence(sequence_ID, sequence_name,
                                sequence_description)

            for xmlOrder in xmlRoot.findall("{" + namespace + "}order"):
                order = Order.loadFromXML(xmlOrder, vocabulary, namespace,
                                          version)
                sequence.addOrder(order)

            return sequence

        return None