aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/command_build.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2013-02-27 09:13:24 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2013-02-27 09:13:24 -0300
commit878ba1152ebc64a4a2609d23c9e400a6111db642 (patch)
tree7672c12a59dbab1864606109e4f2b1dd7534043c /nikola/plugins/command_build.py
parenta40930043121a4b60de8526d58417761a54ab718 (diff)
Imported Upstream version 5.3upstream/5.3
Diffstat (limited to 'nikola/plugins/command_build.py')
-rw-r--r--nikola/plugins/command_build.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/nikola/plugins/command_build.py b/nikola/plugins/command_build.py
index 29d4c9d..8a1de5f 100644
--- a/nikola/plugins/command_build.py
+++ b/nikola/plugins/command_build.py
@@ -38,8 +38,10 @@ class CommandBuild(Command):
"""Build the site using doit."""
# FIXME: this is crap, do it right
- with tempfile.NamedTemporaryFile(suffix='.py', delete=False) as dodo:
- dodo.write(b'''
+ with tempfile.NamedTemporaryFile(suffix='.py', delete=False) as self.dodo:
+ self.dodo.write(b'''
+import sys
+sys.path.insert(0, '.')
from doit.reporter import ExecutedOnlyReporter
DOIT_CONFIG = {
'reporter': ExecutedOnlyReporter,
@@ -53,12 +55,13 @@ SITE = Nikola(**conf.__dict__)
def task_render_site():
return SITE.gen_tasks()
''')
- dodo.flush()
+ self.dodo.flush()
first = args[0] if args else None
if first in ('auto', 'clean', 'forget', 'ignore', 'list', 'run'):
cmd = first
args = args[1:]
else:
cmd = 'run'
- os.system('doit %s -f %s -d . %s' % (cmd, dodo.name,
+ os.system('doit %s -f %s -d . %s' % (cmd, self.dodo.name,
''.join(args)))
+ os.unlink(self.dodo.name)