コード例 #1
0
ファイル: taxonomy_loader.py プロジェクト: shelcrow/pyoblib
    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])
コード例 #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])
コード例 #3
0
ファイル: test_taxonomy.py プロジェクト: jessiedeot/pyoblib
 def test_unit(self):
     self.assertIsInstance(taxonomy.Unit(), taxonomy.Unit)