Repository: getnikola/nikola

Issue:
nikola auto not working 
I'm a newb so suspect user error, but I installed nikola v6.3.0 (pip install nikola) and have not been able to get **nikola auto** to work.

Initially I was getting errors due to a more recent version of livereload (which, isn't this marked as fixed?) and resolved by forcing livereload=2.0.0. 

The next problem is that the site appears not to rebuild when I save edits to a post. I have not RTFM yet (as instructed :) but when I do:
  nikola auto -b 

I should be able to edit a post file (e.g. 1.rst) and on save, see the changes immediately, correct? What I see in the server log output and in Chrome dev tools shows that the browser is re-requesting a bunch of files, but I have to manually do **nikola build** to get the site to rebuild. 

I'm using OS X 10.9.1, Python 2.7. Let me know if I can provide any other info; if I get it worked out I'll update the issue. 



Discussion:
Log output below. Note I'm exploring the demo site (**nikola init --demo nikola-test**)

$ nikola auto
Scanning posts....done!
[2014-02-22T16:33:05Z] NOTICE: Nikola: galleries/demo/index.txt is scheduled to be published in the future (2014-02-22 15:30:53+00:00)
Serving on 127.0.0.1:8000
INFO:root:Browser Connected: http://localhost:8000/
INFO:root:Start watching changes
INFO:root:File conf.py changed
INFO:root:ignore this reload action
INFO:root:Browser Connected: http://localhost:8000/
INFO:root:File posts/1.rst changed
INFO:root:Reload 2 waiters
INFO:tornado.access:200 GET / (::1) 1.10ms
INFO:tornado.access:200 GET / (::1) 0.87ms
INFO:tornado.access:200 GET /livereload.js (::1) 1.03ms
INFO:tornado.access:200 GET /assets/css/all-nocdn.css (::1) 2.61ms
INFO:tornado.access:200 GET /assets/js/all-nocdn.js (::1) 1.60ms
INFO:tornado.access:200 GET /assets/css/all-nocdn.css (::1) 1.63ms
INFO:tornado.access:200 GET /livereload.js (::1) 12.10ms
INFO:tornado.access:200 GET /assets/js/all-nocdn.js (::1) 1.60ms
INFO:tornado.access:200 GET /assets/css/images/overlay.png (::1) 1.02ms
INFO:tornado.access:200 GET /assets/css/images/overlay.png (::1) 0.99ms
WARNING:tornado.access:404 GET /assets/js/jquery-1.10.2.min.map (::1) 0.68ms
WARNING:tornado.access:404 GET /assets/js/jquery-1.10.2.min.map (::1) 0.81ms
INFO:root:Browser Connected: http://localhost:8000/
INFO:root:Browser Connected: http://localhost:8000/
INFO:tornado.access:200 GET / (::1) 0.66ms
INFO:tornado.access:304 GET /livereload.js (::1) 0.80ms
INFO:tornado.access:200 GET /assets/css/all-nocdn.css (::1) 1.74ms
INFO:tornado.access:200 GET /assets/js/all-nocdn.js (::1) 3.30ms
INFO:tornado.access:200 GET /assets/css/images/overlay.png (::1) 0.95ms
INFO:root:Browser Connected: http://localhost:8000/

> Initially I was getting errors due to a more recent version of livereload (which, isn't this marked as fixed?) and resolved by forcing livereload=2.0.0.

Marked as fixed because it is fixed in master.  This bug surfaced after release.  Nikola now freezes livereload to prevent future bugs due to such ugly API changes.

---

> I should be able to edit a post file (e.g. 1.rst) and on save, see the changes immediately, correct? What I see in the server log output and in Chrome dev tools shows that the browser is re-requesting a bunch of files, but I have to manually do nikola build to get the site to rebuild.

Reproduced.  Will try to fix.


Resolving patch:
diff --git a/nikola/plugins/command/auto.py b/nikola/plugins/command/auto.py
--- a/nikola/plugins/command/auto.py
+++ b/nikola/plugins/command/auto.py
@@ -64,20 +64,20 @@ def _execute(self, options, args):
             req_missing(['livereload>=2.0.0'], 'use the "auto" command')
             return
 
-        # Run an initial build so we are uptodate
+        # Run an initial build so we are up-to-date
         subprocess.call(("nikola", "build"))
 
         port = options and options.get('port')
 
         server = Server()
-        server.watch('conf.py')
-        server.watch('themes/')
-        server.watch('templates/')
+        server.watch('conf.py', 'nikola build')
+        server.watch('themes/', 'nikola build')
+        server.watch('templates/', 'nikola build')
         server.watch(self.site.config['GALLERY_PATH'])
         for item in self.site.config['post_pages']:
-            server.watch(os.path.dirname(item[0]))
+            server.watch(os.path.dirname(item[0]), 'nikola build')
         for item in self.site.config['FILES_FOLDERS']:
-            server.watch(os.path.dirname(item))
+            server.watch(os.path.dirname(item), 'nikola build')
 
         out_folder = self.site.config['OUTPUT_FOLDER']
         if options and options.get('browser'):


Test patch: