Skip to content

Commit

Permalink
if inline
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCastellano committed Mar 11, 2017
1 parent 4c5bd7d commit 755e71f
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions bormeparser/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,7 @@ def get_url_pdfs_provincia(date, provincia, secure=USE_HTTPS):
""" Obtiene las URLs para descargar los BORMEs de la provincia y fecha indicada """
url = get_url_xml(date, secure=secure)
req = requests.get(url)
if secure:
protocol = 'https'
else:
protocol = 'http'
protocol = 'https' if secure else 'http'
content = req.text.encode('iso-8859-1')
tree = etree.fromstring(content).getroottree()

Expand Down Expand Up @@ -200,10 +197,7 @@ def get_url_pdfs_seccion(date, seccion, secure=USE_HTTPS):

url = get_url_xml(date, secure=secure)
req = requests.get(url)
if secure:
protocol = 'https'
else:
protocol = 'http'
protocol = 'https' if secure else 'http'
content = req.text.encode('iso-8859-1')
tree = etree.fromstring(content).getroottree()

Expand Down Expand Up @@ -248,10 +242,7 @@ def get_url_seccion_c(date, format='xml', secure=USE_HTTPS):

url = get_url_xml(date, secure=secure)
req = requests.get(url)
if secure:
protocol = 'https'
else:
protocol = 'http'
protocol = 'https' if secure else 'http'
content = req.text.encode('iso-8859-1')
tree = etree.fromstring(content).getroottree()

Expand Down

0 comments on commit 755e71f

Please sign in to comment.