|
|
|
@ -19,7 +19,7 @@ except ImportError: |
|
|
|
from io import StringIO |
|
|
|
|
|
|
|
try: |
|
|
|
import flags |
|
|
|
from . import flags |
|
|
|
except ImportError: |
|
|
|
raise Exception('Falhou ao importar flags') |
|
|
|
# from geraldo.utils import memoize |
|
|
|
@ -58,7 +58,7 @@ CARACTERS_ACENTUADOS = { |
|
|
|
|
|
|
|
# @memoize |
|
|
|
def normalizar_municipio(municipio): |
|
|
|
if not isinstance(municipio, unicode): |
|
|
|
if not isinstance(municipio, str): |
|
|
|
municipio = municipio.decode('utf-8') |
|
|
|
|
|
|
|
return municipio.lower().translate(CARACTERS_ACENTUADOS).upper() |
|
|
|
@ -66,7 +66,7 @@ def normalizar_municipio(municipio): |
|
|
|
|
|
|
|
# @memoize |
|
|
|
def carregar_arquivo_municipios(uf, reverso=False): |
|
|
|
if isinstance(uf, basestring): |
|
|
|
if isinstance(uf, str): |
|
|
|
try: |
|
|
|
uf = int(uf) |
|
|
|
except ValueError: |
|
|
|
|