Beispiel #1
0
    def startElement(self, name, attrs):
        if name == "unit":
            for item in attrs.items():
                if item[0] == "id":

                    self._curr = taxonomy.Unit()
                    self._curr.id = item[1]
        elif name == "xs:enumeration":
            for item in attrs.items():
                if item[0] == "value":
                    self._curr.append(item[1])
Beispiel #2
0
    def startElement(self, name, attrs):
        if name == "unit":
            for item in attrs.items():
                if item[0] == "id":

                    # Temporary fix for the circular dependency issue
                    from oblib import taxonomy

                    self._curr = taxonomy.Unit()
                    self._curr.id = item[1]
        elif name == "xs:enumeration":
            for item in attrs.items():
                if item[0] == "value":
                    self._curr.append(item[1])
Beispiel #3
0
 def test_unit(self):
     self.assertIsInstance(taxonomy.Unit(), taxonomy.Unit)