From: Thadeu Lima de Souza Cascardo Date: Sun, 23 Mar 2014 20:30:55 +0000 (-0300) Subject: Classes para listas de quadros, com itens valorados. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Firpf-gui.git;a=commitdiff_plain;h=4087b386461fd0a4553d7a84bf9170c5b5785614 Classes para listas de quadros, com itens valorados. Ao invés de uma lista de itens com um código, rendimentos isentos ou tributados exclusivamente na fonte possuem vários quadros, representando diferentes formas de rendimento (poupança, ações, etc), sendo cada quadro uma lista de itens com especificação e valor apenas. --- diff --git a/src/quadros.py b/src/quadros.py new file mode 100644 index 0000000..216f11c --- /dev/null +++ b/src/quadros.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# +# Copyright 2013 Thadeu Lima de Souza Cascardo +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# -*- mode: python; encoding: utf-8; -*- + +import xml.dom.minidom +import items +from form import AttrForm + +class Quadro(items.Items): + def __init__(self, name, el): + self.name = name + items.Items.__init__(self, el) + def form(self, item): + f = [] + f.append(AttrForm(u"Descrição", "especificacao", item)) + f.append(AttrForm(u"Valor", "valor", item)) + return f + +class Quadros: + def __init__(self, el, subels): + self.quadros = [] + for i in subels: + self.quadros.append(Quadro(i[0], el.getElementsByTagName(i[1])[0])) + +# vim:tabstop=4:expandtab:smartindent