spanezz / staticsite

Static site generator
GNU General Public License v3.0
47 stars 7 forks source link

Reload when staticsite code changes #44

Open spanezz opened 4 years ago

spanezz commented 4 years ago

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.