Skip to content

Commit

Permalink
Remocao de variáveis mágicas #13
Browse files Browse the repository at this point in the history
  • Loading branch information
lopes05 committed Jun 14, 2018
1 parent 24b4a6b commit 30c392c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions radar_parlamentar/importadores/camara_genero/num_genero_legis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
historia = {}

cont = 0

SEXO_FEMININO = "F"
SEXO_MASCULINO = "M"

for arq in arqs:
if arq[0] != ".":
ponteiro = open("bios/" + arq)
Expand All @@ -23,10 +27,10 @@
for record in records:
dep = record.getElementsByTagName('MANDATOSCD')[0].firstChild.data
if dep.find("Deputada") != -1:
genero = "F"
genero = SEXO_FEMININO
cont += 1
else:
genero = "M"
genero = SEXO_MASCULINO
nome = record.getElementsByTagName('TXTNOME')[0].firstChild.data
legis_anos = record.getElementsByTagName(
'LEGISLATURAS')[0].firstChild.data
Expand Down Expand Up @@ -60,7 +64,7 @@
total = len(historia[i])
for pessoa in historia[i]:
gen = generos[pessoa]
if gen == "F":
if gen == SEXO_FEMININO:
femi += 1
else:
masc += 1
Expand Down

0 comments on commit 30c392c

Please sign in to comment.