/usr/lib/python3/dist-packages/livereload-2.4.0.egg-info/PKG-INFO is in python3-livereload 2.4.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | Metadata-Version: 1.1
Name: livereload
Version: 2.4.0
Summary: Python LiveReload is an awesome tool for web developers
Home-page: https://github.com/lepture/python-livereload
Author: Hsiaoming Yang
Author-email: me@lepture.com
License: BSD
Description: LiveReload
==========
This is a brand new LiveReload in version 2.0.0.
.. image:: https://pypip.in/d/livereload/badge.png
:target: https://pypi.python.org/pypi/livereload
:alt: Downloads
.. image:: https://pypip.in/v/livereload/badge.png
:target: https://pypi.python.org/pypi/livereload
:alt: Version
Installation
------------
Python LiveReload is designed for web developers who know Python.
Install Python LiveReload with pip::
$ pip install livereload
If you don't have pip installed, try easy_install::
$ easy_install livereload
Command Line Interface
----------------------
Python LiveReload provides a command line utility, ``livereload``, for starting a server in a directory.
By default, it will listen to port 35729, the common port for `LiveReload browser extensions`_. ::
$ livereload --help
usage: livereload [-h] [-p PORT] [directory]
Start a `livereload` server
positional arguments:
directory Directory to watch for changes
optional arguments:
-h, --help show this help message and exit
-p PORT, --port PORT Port to run `livereload` server on
.. _`livereload browser extensions`: http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-
Older versions of Python LiveReload used a ``Guardfile`` to describe optional additional rules for files to watch and build commands to run on changes. 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. Instead of a ``Guardfile`` you can now write a Python script using very similar syntax and run it instead of the command line application.
Script example: Sphinx
----------------------
Here's a simple example script that rebuilds Sphinx documentation:
.. code:: python
#!/usr/bin/env python
from livereload import Server, shell
server = Server()
server.watch('docs/*.rst', shell('make html', cwd='docs'))
server.serve(root='docs/_build/html')
Run it, then open http://localhost:5500/ and you can see the documentation changes in real time.
Developer Guide
---------------
The new livereload server is designed for developers. It can power a
wsgi application now:
.. code:: python
from livereload import Server, shell
server = Server(wsgi_app)
# run a shell command
server.watch('static/*.stylus', 'make static')
# run a function
def alert():
print('foo')
server.watch('foo.txt', alert)
# output stdout into a file
server.watch('style.less', shell('lessc style.less', output='style.css'))
server.serve()
The ``Server`` class accepts parameters:
- app: a wsgi application
- watcher: a watcher instance, you don't have to create one
server.watch
~~~~~~~~~~~~
``server.watch`` can watch a filepath, a directory and a glob pattern::
server.watch('path/to/file.txt')
server.watch('directory/path/')
server.watch('glob/*.pattern')
You can also use other library (for example: formic) for more powerful
file adding::
for filepath in formic.FileSet(include="**.css"):
server.watch(filepath, 'make css')
You can delay a certain seconds to send the reload signal::
# delay 2 seconds for reloading
server.watch('path/to/file', delay=2)
server.serve
~~~~~~~~~~~~
Setup a server with ``server.serve`` method. It can create a static server
and a livereload server::
# use default settings
server.serve()
# livereload on another port
server.serve(liveport=35729)
# use custom host and port
server.serve(port=8080, host='localhost')
# open the web browser on startup
server.serve(open_url=True, debug=False)
shell
~~~~~
The powerful ``shell`` function will help you to execute shell commands. You
can use it with ``server.watch``::
# you can redirect command output to a file
server.watch('style.less', shell('lessc style.less', output='style.css'))
# commands can be a list
server.watch('style.less', shell(['lessc', 'style.less'], output='style.css'))
# working with Makefile
server.watch('assets/*.styl', shell('make assets', cwd='assets'))
Frameworks Integration
----------------------
Livereload can work seamlessly with your favorite framework.
Django
~~~~~~
Here is a little hint on Django. Change your ``manage.py`` file to:
.. code:: python
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hello.settings")
from django.core.management import execute_from_command_line
if 'livereload' in sys.argv:
from django.core.wsgi import get_wsgi_application
from livereload import Server
application = get_wsgi_application()
server = Server(application)
# Add your watch
# server.watch('path/to/file', 'your command')
server.serve()
else:
execute_from_command_line(sys.argv)
When you execute ``./manage.py livereload``, it will start a livereload server.
Flask
~~~~~
Wrap Flask with livereload is much simpler:
.. code:: python
# app is a Flask object
app = create_app()
server = Server(app.wsgi_app)
# server.watch
server.serve()
Bottle
~~~~~~
Wrap the ``Bottle`` app with livereload server:
.. code:: python
app = Bottle()
server = Server(app)
# server.watch
server.serve()
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: Web Environment :: Mozilla
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Debuggers
|