aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/command/install_theme.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2014-10-21 10:33:17 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2014-10-21 10:33:17 -0300
commit2d14c4b384c7000e264674a92b16e010a510ac05 (patch)
tree7676db09f338e46e053170b1c9f7594120b9d434 /nikola/plugins/command/install_theme.py
parent2d2e97ac540c94e15ac5eccc7d32f3dfb3eea1bc (diff)
parent5ec02211214350ee558fd9f6bb052264fd24f75e (diff)
Merge tag 'upstream/7.1.0'
Upstream version 7.1.0
Diffstat (limited to 'nikola/plugins/command/install_theme.py')
-rw-r--r--nikola/plugins/command/install_theme.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/nikola/plugins/command/install_theme.py b/nikola/plugins/command/install_theme.py
index 859bd56..5397772 100644
--- a/nikola/plugins/command/install_theme.py
+++ b/nikola/plugins/command/install_theme.py
@@ -26,10 +26,9 @@
from __future__ import print_function
import os
-import codecs
+import io
import json
import shutil
-from io import BytesIO
import pygments
from pygments.lexers import PythonLexer
@@ -137,7 +136,7 @@ class CommandInstallTheme(Command):
if name in data:
utils.makedirs(self.output_dir)
LOGGER.info('Downloading: ' + data[name])
- zip_file = BytesIO()
+ zip_file = io.BytesIO()
zip_file.write(requests.get(data[name]).content)
LOGGER.info('Extracting: {0} into themes'.format(name))
utils.extract_all(zip_file)
@@ -161,7 +160,7 @@ class CommandInstallTheme(Command):
if os.path.exists(confpypath):
LOGGER.notice('This theme has a sample config file. Integrate it with yours in order to make this theme work!')
print('Contents of the conf.py.sample file:\n')
- with codecs.open(confpypath, 'rb', 'utf-8') as fh:
+ with io.open(confpypath, 'r', encoding='utf-8') as fh:
if self.site.colorful:
print(indent(pygments.highlight(
fh.read(), PythonLexer(), TerminalFormatter()),