Tabs e vim
[cascardo/irpf-gui.git] / bens.py
diff --git a/bens.py b/bens.py
index e47a454..02a8499 100644 (file)
--- a/bens.py
+++ b/bens.py
@@ -18,38 +18,40 @@ import xml.dom.minidom
 from contribuinte import Contribuinte
 
 class Bem:
-       def __init__(self, el):
-               self.bem = el
-       def get_attr(self, attr):
-               if attr in self.bem.attributes.keys():
-                       return self.bem.attributes[attr].nodeValue
-               return None
-       def set_attr(self, attr, val):
-               self.bem.attributes[attr].nodeValue = val
+    def __init__(self, el):
+        self.bem = el
+        def get_attr(self, attr):
+            if attr in self.bem.attributes.keys():
+                return self.bem.attributes[attr].nodeValue
+            return None
+        def set_attr(self, attr, val):
+            self.bem.attributes[attr].nodeValue = val
 
 class Bens:
-       def __init__(self, contribuinte):
-               self.contribuinte = contribuinte
-               self.bens = self.contribuinte.dados.getElementsByTagName("bens")[0]
-               self.items = []
-               for i in self.bens.getElementsByTagName("item"):
-                       self.items.append(Bem(i))
-       def _get_attr(self, el, attr):
-               if attr in el.attributes.keys():
-                       return el.attributes[attr].nodeValue
-               return None
-       def _set_attr(self, el, attr, val):
-               el.attributes[attr].nodeValue = val
-       def get_bens(self, attr):
-               return self._get_attr(self.bens, attr)
-       def set_bens(self, attr, val):
-               self._set_attr(self.bens, attr, val)
+    def __init__(self, contribuinte):
+        self.contribuinte = contribuinte
+                self.bens = self.contribuinte.dados.getElementsByTagName("bens")[0]
+                self.items = []
+                for i in self.bens.getElementsByTagName("item"):
+                    self.items.append(Bem(i))
+        def _get_attr(self, el, attr):
+            if attr in el.attributes.keys():
+                return el.attributes[attr].nodeValue
+            return None
+        def _set_attr(self, el, attr, val):
+            el.attributes[attr].nodeValue = val
+        def get_bens(self, attr):
+            return self._get_attr(self.bens, attr)
+        def set_bens(self, attr, val):
+            self._set_attr(self.bens, attr, val)
 
 if __name__ == '__main__':
-       import sys
-       contribuinte = Contribuinte(sys.argv[1])
-       bens = Bens(contribuinte)
-       print "anterior: " + bens.get_bens("totalExercicioAnterior")
-       print "atual: " + bens.get_bens("totalExercicioAtual")
-       for i in bens.items:
-               print i.get_attr("valorExercicioAtual") + " " + i.get_attr("discriminacao")
+    import sys
+        contribuinte = Contribuinte(sys.argv[1])
+        bens = Bens(contribuinte)
+        print "anterior: " + bens.get_bens("totalExercicioAnterior")
+        print "atual: " + bens.get_bens("totalExercicioAtual")
+        for i in bens.items:
+            print i.get_attr("valorExercicioAtual") + " " + i.get_attr("discriminacao")
+
+# vim:tabstop=4:expandtab:smartindent