X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Firpf-gui.git;a=blobdiff_plain;f=src%2FrendimentoPJ.py;h=64d584479d9999c00921ee96d34c7a91dbb5c54e;hp=ddd3318abbaf5e0d5fa6bc0ea2b792fef6ad0f3c;hb=bfef3f772c6c787190004dea89caf1e3acddbf84;hpb=8ad130ba92d8d4039ff6efc5eb0c113ebb56ef68 diff --git a/src/rendimentoPJ.py b/src/rendimentoPJ.py index ddd3318..64d5844 100644 --- a/src/rendimentoPJ.py +++ b/src/rendimentoPJ.py @@ -18,8 +18,11 @@ import xml.dom.minidom from contribuinte import Contribuinte class RendimentoPJ: - def __init__(self, el): - self.rendimento = el + def __init__(self, el = None): + if el == None: + self.rendimento = xml.dom.minidom.Element("item") + else: + self.rendimento = el def get_attr(self, attr): if attr in self.rendimento.attributes.keys(): @@ -27,7 +30,7 @@ class RendimentoPJ: return None def set_attr(self, attr, val): - self.rendimento.attributes[attr].nodeValue = val + self.rendimento.setAttribute(attr, val) class RendimentosPJ: def __init__(self, contribuinte): @@ -53,6 +56,10 @@ class RendimentosPJ: def set_colecao(self, attr, val): self._set_attr(self.colecao, attr, val) + def add_item(self, item): + self.items.append(item) + self.colecao.appendChild(item.rendimento) + if __name__ == '__main__': import sys