summaryrefslogtreecommitdiffstats
path: root/nikola/plugins/command/console.py
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/plugins/command/console.py')
-rw-r--r--nikola/plugins/command/console.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/nikola/plugins/command/console.py b/nikola/plugins/command/console.py
index 3d3daab..c6a8376 100644
--- a/nikola/plugins/command/console.py
+++ b/nikola/plugins/command/console.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2015 Chris Warrick, Roberto Alsina and others.
+# Copyright © 2012-2016 Chris Warrick, Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -75,7 +75,7 @@ If there is no console to use specified (as -b, -i, -p) it tries IPython, then f
]
def ipython(self, willful=True):
- """IPython shell."""
+ """Run an IPython shell."""
try:
import IPython
except ImportError as e:
@@ -84,12 +84,13 @@ If there is no console to use specified (as -b, -i, -p) it tries IPython, then f
raise e # That’s how _execute knows whether to try something else.
else:
site = self.context['site'] # NOQA
+ nikola_site = self.context['site'] # NOQA
conf = self.context['conf'] # NOQA
commands = self.context['commands'] # NOQA
IPython.embed(header=self.header.format('IPython'))
def bpython(self, willful=True):
- """bpython shell."""
+ """Run a bpython shell."""
try:
import bpython
except ImportError as e:
@@ -100,7 +101,7 @@ If there is no console to use specified (as -b, -i, -p) it tries IPython, then f
bpython.embed(banner=self.header.format('bpython'), locals_=self.context)
def plain(self, willful=True):
- """Plain Python shell."""
+ """Run a plain Python shell."""
import code
try:
import readline
@@ -130,6 +131,7 @@ If there is no console to use specified (as -b, -i, -p) it tries IPython, then f
self.context = {
'conf': self.site.config,
'site': self.site,
+ 'nikola_site': self.site,
'commands': self.site.commands,
}
if options['bpython']: