Skip to content
Permalink
Browse files

Handle error downloading bootswatch, fixes #2054

  • Loading branch information
ralsina committed Sep 10, 2015
1 parent acf5fb7 commit b8cf5dd80cb94f38b329f5c512902bde735c7015
Showing with 6 additions and 1 deletion.
  1. +1 −0 CHANGES.txt
  2. +5 −1 nikola/plugins/command/bootswatch_theme.py
@@ -16,6 +16,7 @@ Features
Bugfixes
--------

* Handle error downloading bootswatches (Issue #2054)
* Monitor plugins/ in ``nikola auto`` (Issue #2044)
* Multi-lingual and multi-level directories confused section slug
detection (Issue #2023)
@@ -96,7 +96,11 @@ def _execute(self, options, args):
url += '/' + version
url = '/'.join((url, swatch, fname))
LOGGER.info("Downloading: " + url)
data = requests.get(url).text
r = requests.get(url)
if r.status_code > 299:
LOGGER.error('Error {} getting {}', r.status_code, url)
exit(1)
data = r.text
with open(os.path.join('themes', name, 'assets', 'css', fname),
'wb+') as output:
output.write(data.encode('utf-8'))

0 comments on commit b8cf5dd

Please sign in to comment.