- irpf_dir = dirs.get_default_irpf_dir()
- self.xml = xml.dom.minidom.parse(irpf_dir.get_resource_file("ocupacoesPrincipal.xml"))
- self.l = []
- self.g = {}
- self._list()
- self._group()
-
- def _list(self):
- for i in self.xml.getElementsByTagName("ITEM"):
- if "COL4" in i.attributes.keys():
- self.l.append((i.attributes["COL1"].nodeValue, \
- i.attributes["COL2"].nodeValue, \
- i.attributes["COL3"].nodeValue, \
- i.attributes["COL4"].nodeValue))
-
- def list(self):
- return self.l
-
- def _group(self):
- for i in self.l:
- if i[1] not in self.g:
- self.g[i[1]] = []
- self.g[i[1]].append(i)
-
- def groups(self):
- return self.g
+ tipos.Tipos.__init__(self, "ocupacoesPrincipal.xml", ["COL1", "COL2", "COL3", "COL4"], 1)