mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-28 13:05:11 +00:00
Implement watching static files
This commit is contained in:
19
lib/debug.py
Normal file
19
lib/debug.py
Normal file
@ -0,0 +1,19 @@
|
||||
from glob import iglob as glob
|
||||
from itertools import chain
|
||||
|
||||
from tornado.autoreload import watch
|
||||
|
||||
|
||||
# yo dawg, we heard you like generators, so now you can generate generators
|
||||
# with generators
|
||||
def _static_files():
|
||||
return chain.from_iterable(
|
||||
glob(pattern) for pattern in (
|
||||
'static/*.js', 'static/*.css', 'templates/*htm?'
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def watch_static_files():
|
||||
for file in _static_files():
|
||||
watch(file)
|
Reference in New Issue
Block a user