Skip to content

Commit

Permalink
doc regex_empresa_tipo y rstrip
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCastellano committed Oct 7, 2016
1 parent d74dbec commit d7b2ef4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bormeparser/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,18 @@ def regex_noarg(data):


def regex_empresa_tipo(data):
"""
data: "GRUAS BANCALERO SL"
return empresa: "GRUAS BANCALERO"
return tipo: "SL"
"""
empresa = data
tipo = ''
for t in ALL_SOCIEDADES:
if data.endswith(' %s' % t):
empresa = data[:-len(t) - 1]
tipo = t
if empresa.endswith(','):
empresa = empresa[:-1]
empresa = empresa.rstrip(",")
return empresa, tipo


Expand Down

0 comments on commit d7b2ef4

Please sign in to comment.