Fix: Tabs estavam "zuados"
authorEduardo Elias Camponez <camponez@gmail.com>
Sun, 5 May 2013 19:09:51 +0000 (16:09 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@cascardo.info>
Tue, 7 May 2013 11:11:12 +0000 (08:11 -0300)
src/bens.py

index a098e79..7103eae 100644 (file)
@@ -20,20 +20,24 @@ 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 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))
+        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():
@@ -51,11 +55,13 @@ class Bens:
 
 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")
+
+    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