watch ( 'static/*.stylus', 'make static' ) # run a function def alert (): print ( 'foo' ) server. Wsgi application now: from livereload import Server, shell server = Server ( wsgi_app ) # run a shell command server. The new livereload server is designed for developers. Run it, then open and you can see the documentation changes in real time. watch ( 'docs/*.rst', shell ( 'make html', cwd = 'docs' )) server. Here’s a simple example script that rebuilds Sphinx documentation: #!/usr/bin/env python from livereload import Server, shell server = Server () server. Instead of a Guardfile you can now write a Python script using very similar syntax and run it instead of the command line application. This conflicted with other tools that used the same file for their configuration and is no longer supported since Python LiveReload version 2.0.0. Older versions of Python LiveReload used a Guardfile to describe optional additional rules for files to watch and build commands to run on changes. w WAIT, -wait WAIT Time delay before reloading p PORT, -port PORT Port to run `livereload` server on h, -help show this help message and exit Python LiveReload provides a command line utility, livereload, for starting a server in a directory.īy default, it will listen to port 35729, the common port for LiveReload browser extensions. If you don’t have pip installed, try easy_install: $ easy_install livereload Command Line Interface Install Python LiveReload with pip: $ pip install livereload Python LiveReload is designed for web developers who know Python. This is a brand new LiveReload in version 2.0.0.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |