getnikola/nikola — pull request #885 by jbarratt (2013-10-28 21:18:07+00:00)
Title: Fix Guardfile generated by auto command 

I was getting the error

```
ERROR:tornado.application:Error in periodic callback
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/tornado/ioloop.py", line 794, in _run
self.callback()
File "/usr/local/lib/python2.7/site-packages/livereload/server.py", line 54, in watch_tasks
changes = Task.watch()
File "/usr/local/lib/python2.7/site-packages/livereload/task.py", line 44, in watch
func and func()
File "Guardfile", line 8, in f
subprocess.call(("nikola", "build"))
NameError: global name 'subprocess' is not defined
```

which happens because the callback is executed in a different context where ``subprocess`` is not defined. (See [livereload docs](http://livereload.readthedocs.org/en/latest/guardfile.html#define-a-function)). This fixes the problem by simply reimporting ``subprocess`` each time. Tested, and it works.