diff options
| author | 2013-02-13 18:35:39 -0300 | |
|---|---|---|
| committer | 2013-02-13 18:35:39 -0300 | |
| commit | a40930043121a4b60de8526d58417761a54ab718 (patch) | |
| tree | 383c5cf8e320761ee942619282fe51be625179a7 /nikola/plugins/command_bootswatch_theme.py | |
| parent | 9c5708cc92af894e414bc76ee35ec2230de5d288 (diff) | |
Imported Upstream version 5.2upstream/5.2
Diffstat (limited to 'nikola/plugins/command_bootswatch_theme.py')
| -rw-r--r-- | nikola/plugins/command_bootswatch_theme.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/nikola/plugins/command_bootswatch_theme.py b/nikola/plugins/command_bootswatch_theme.py index 185717f..6c1061f 100644 --- a/nikola/plugins/command_bootswatch_theme.py +++ b/nikola/plugins/command_bootswatch_theme.py @@ -29,7 +29,7 @@ import os try: import requests except ImportError: - requests = None + requests = None # NOQA from nikola.plugin_categories import Command @@ -42,16 +42,19 @@ class CommandBootswatchTheme(Command): def run(self, *args): """Given a swatch name and a parent theme, creates a custom theme.""" if requests is None: - print('To use the install_theme command, you need to install the "requests" package.') + print('To use the install_theme command, you need to install the ' + '"requests" package.') return parser = OptionParser(usage="nikola %s [options]" % self.name) parser.add_option("-n", "--name", dest="name", - help="New theme name (default: custom)", default='custom') + help="New theme name (default: custom)", + default='custom') parser.add_option("-s", "--swatch", dest="swatch", - help="Name of the swatch from bootswatch.com (default: slate)", - default='slate') + help="Name of the swatch from bootswatch.com " + "(default: slate)", default='slate') parser.add_option("-p", "--parent", dest="parent", - help="Parent theme name (default: site)", default='site') + help="Parent theme name (default: site)", + default='site') (options, args) = parser.parse_args(list(args)) name = options.name @@ -68,11 +71,11 @@ class CommandBootswatchTheme(Command): url = 'http://bootswatch.com/%s/%s' % (swatch, fname) print("Downloading: ", url) data = requests.get(url).text - with open(os.path.join( - 'themes', name, 'assets', 'css', fname), 'wb+') as output: + with open(os.path.join('themes', name, 'assets', 'css', fname), + 'wb+') as output: output.write(data) with open(os.path.join('themes', name, 'parent'), 'wb+') as output: output.write(parent) - print('Theme created. Change the THEME setting to "%s" to use it.' - % name) + print('Theme created. Change the THEME setting to "%s" to use it.' % + name) |
