3 # Copyright 2013-2014 Thadeu Lima de Souza Cascardo <cascardo@cascardo.info>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # -*- mode: python; encoding: utf-8; -*-
19 import xml.dom.minidom
24 class Declaracoes(items.Items):
26 irpf_dir = dirs.get_default_irpf_dir()
28 if not os.path.exists(irpf_dir.get_resource_dir()):
29 raise RuntimeError("O caminho para o resource não existe: " + \
30 irpf_dir.get_resource_dir())
32 if not os.path.exists(irpf_dir.get_userdata_dir()):
33 raise RuntimeError("O caminho para os dados não existe: " + \
34 irpf_dir.get_userdata_dir())
36 self.iddecl_file = irpf_dir.get_userdata_file("iddeclaracoes.xml")
37 self.declaracoes = xml.dom.minidom.parse(self.iddecl_file)
38 classe = self.declaracoes.getElementsByTagName("classe")[0]
39 items.Items.__init__(self, classe)
42 self.declaracoes.writexml(open(self.iddecl_file, "w"))
46 "declaracaoRetificadora",
52 "numeroReciboDecAnterior",
53 "resultadoDeclaracao",
60 if __name__ == '__main__':
65 print i.get_attr("cpf") + " " + i.get_attr("nome")
67 # vim:tabstop=4:expandtab:smartindent