File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66 HTTP and WebSocket handlers for livereload.
77
8- :copyright: (c) 2013 - 2015 by Hsiaoming Yang
8+ :copyright: (c) 2013 by Hsiaoming Yang
99 :license: BSD, see LICENSE for more details.
1010"""
1111
1212import os
1313import time
1414import logging
15- from pkg_resources import resource_string
1615from tornado import web
1716from tornado import ioloop
1817from tornado import escape
@@ -138,7 +137,10 @@ class LiveReloadJSHandler(web.RequestHandler):
138137
139138 def get (self ):
140139 self .set_header ('Content-Type' , 'application/javascript' )
141- self .write (resource_string (__name__ , 'vendors/livereload.js' ))
140+ root = os .path .abspath (os .path .dirname (__file__ ))
141+ js_file = os .path .join (root , 'vendors/livereload.js' )
142+ with open (js_file , 'rb' ) as f :
143+ self .write (f .read ())
142144
143145
144146class ForceReloadHandler (web .RequestHandler ):
You can’t perform that action at this time.
0 commit comments