Repository: getnikola/nikola

Issue:
Bootswatch installer tries to use a local host named the same as the swatch
``` pytb
[2014-04-04T14:54:00Z] INFO: bootswatch_theme: Creating 'custom' theme from 'cerulean' and 'bootstrap3'
[2014-04-04T14:54:00Z] INFO: bootswatch_theme: Downloading: http://bootswatch.com//cerulean/bootstrap.min.css
Traceback (most recent call last):
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/doit/doit_cmd.py", line 105, in run
    return self.sub_cmds[command].parse_execute(args)
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/doit/cmd_base.py", line 76, in parse_execute
    return self.execute(params, args)
  File "/home/kwpolska/git/nikola/scripts/../nikola/plugin_categories.py", line 104, in execute
    self._execute(options, args)
  File "/home/kwpolska/git/nikola/nikola/plugins/command/bootswatch_theme.py", line 97, in _execute
    data = requests.get(url).text
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/requests/api.py", line 55, in get
    return request('get', url, **kwargs)
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/requests/sessions.py", line 383, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/requests/sessions.py", line 506, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/requests/sessions.py", line 168, in resolve_redirects
    allow_redirects=False,
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/requests/sessions.py", line 486, in send
    r = adapter.send(request, **kwargs)
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/requests/adapters.py", line 378, in send
    raise ConnectionError(e)
ConnectionError: HTTPConnectionPool(host=u'cerulean', port=80): Max retries exceeded with url: /bootstrap.min.css (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)
```

Fix upcoming.



Discussion:

Resolving patch:
diff --git a/nikola/nikola.py b/nikola/nikola.py
--- a/nikola/nikola.py
+++ b/nikola/nikola.py
@@ -240,6 +240,7 @@ def __init__(self, **config):
             'LICENSE': '',
             'LINK_CHECK_WHITELIST': [],
             'LISTINGS_FOLDER': 'listings',
+            'LOGO_URL': '',
             'NAVIGATION_LINKS': {},
             'MARKDOWN_EXTENSIONS': ['fenced_code', 'codehilite'],
             'MAX_IMAGE_SIZE': 1280,
@@ -259,6 +260,7 @@ def __init__(self, **config):
             'SASS_COMPILER': 'sass',
             'SASS_OPTIONS': [],
             'SEARCH_FORM': '',
+            'SHOW_BLOG_TITLE': True,
             'SHOW_SOURCELINK': True,
             'SHOW_UNTRANSLATED_POSTS': True,
             'SLUG_TAG_PATH': True,
@@ -517,6 +519,8 @@ def __init__(self, **config):
             'DATE_FORMAT', '%Y-%m-%d %H:%M')
         self._GLOBAL_CONTEXT['blog_author'] = self.config.get('BLOG_AUTHOR')
         self._GLOBAL_CONTEXT['blog_title'] = self.config.get('BLOG_TITLE')
+        self._GLOBAL_CONTEXT['show_blog_title'] = self.config.get('SHOW_BLOG_TITLE')
+        self._GLOBAL_CONTEXT['logo_url'] = self.config.get('LOGO_URL')
         self._GLOBAL_CONTEXT['blog_description'] = self.config.get('BLOG_DESCRIPTION')
 
         # TODO: remove in v8
diff --git a/nikola/plugins/command/bootswatch_theme.py b/nikola/plugins/command/bootswatch_theme.py
--- a/nikola/plugins/command/bootswatch_theme.py
+++ b/nikola/plugins/command/bootswatch_theme.py
@@ -92,7 +92,10 @@ def _execute(self, options, args):
         LOGGER.info("Creating '{0}' theme from '{1}' and '{2}'".format(name, swatch, parent))
         utils.makedirs(os.path.join('themes', name, 'assets', 'css'))
         for fname in ('bootstrap.min.css', 'bootstrap.css'):
-            url = '/'.join(('http://bootswatch.com', version, swatch, fname))
+            url = 'http://bootswatch.com'
+            if version:
+                url += '/' + version
+            url = '/'.join((url, swatch, fname))
             LOGGER.info("Downloading: " + url)
             data = requests.get(url).text
             with open(os.path.join('themes', name, 'assets', 'css', fname),


Test patch: