Ejemplo n.º 1
0
    def start_element(self, name, attrs):
        """This is a private function, not to be called from outside NaElement
        """

        n = NaElement(name)
        self.ZAPI_stack.append(n)
        self.ZAPI_atts = {}
        attr_name = list(attrs.keys())
        attr_value = list(attrs.values())
        i = 0
        for att in attr_name:
            val = attr_value[i]
            i = i + 1
            self.ZAPI_atts[att] = val
            n.attr_set(att, val)
    def start_element(self, name, attrs):
        """This is a private function, not to be called from outside NaElement
        """

        n = NaElement(name)
        self.ZAPI_stack.append(n)
        self.ZAPI_atts = {}
        attr_name = list(attrs.keys())
        attr_value = list(attrs.values())
        i = 0
        for att in attr_name :
            val = attr_value[i]
            i = i+1
            self.ZAPI_atts[att] = val
            n.attr_set(att,val)
Ejemplo n.º 3
0
 def fail_response(self, errno, reason):
     """This is a private function, not to be called from outside NaElement
     """
     n = NaElement("results")
     n.attr_set("status", "failed")
     n.attr_set("reason", reason)
     n.attr_set("errno", errno)
     return n
 def fail_response(self, errno, reason):
     """This is a private function, not to be called from outside NaElement
     """
     n = NaElement("results")
     n.attr_set("status","failed")
     n.attr_set("reason",reason)
     n.attr_set("errno",errno)
     return n