Skip to content

Commit

Permalink
clean_empresa solo debe tener código para unificar tipos de sociedades
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCastellano committed Oct 7, 2016
1 parent cb3b548 commit 7b5f595
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 0 additions & 7 deletions bormeparser/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
def clean_empresa(nombre):
sucursal_spain = False

if nombre.endswith('EN LIQUIDACION'):
nombre = nombre[:-15]
if u'SUCURSAL EN ESPAÑA' in nombre:
nombre = nombre.replace(u' SUCURSAL EN ESPAÑA', '')
sucursal_spain = True
nombre.rstrip()
if nombre.endswith(' S.L'):
nombre = nombre[:-3] + 'SL'
if nombre.endswith(' S L'):
Expand Down Expand Up @@ -109,5 +103,4 @@ def clean_empresa(nombre):
if nombre.endswith(' SA SICAV'):
nombre = nombre[:-8] + 'SICAV'

# TODO: return sucursal_spain
return nombre
5 changes: 5 additions & 0 deletions bormeparser/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ def regex_empresa(data, sanitize=True):
else:
acto_id, empresa = REGEX_EMPRESA.match(data).groups()
registro = None

empresa = re.sub(" EN LIQUIDACION$", "", empresa)
empresa = re.sub(u" SUCURSAL EN ESPAÑA$", "", empresa)

empresa = empresa.rstrip('.')

if sanitize:
empresa = clean_empresa(empresa)
return int(acto_id), empresa, registro
Expand Down

0 comments on commit 7b5f595

Please sign in to comment.