spanezz / staticsite

Static site generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reload when staticsite code changes

spanezz opened this issue · comments

Currently staticsite show/serve don't trigger a reload when staticsite's code changes.

/usr/lib/python3/dist-packages/tornado/autoreload.py:_reload_on_update can be a good example of how to list source locations for the current program.

For serve, just doing an exec of sys.argv would be enough. For show, this would cause the new process to bind to a different port, unless --port was used.

Alternatively, we can keep the server socket open and let the new process inherit and use it.