Commits

Robert Brewer committed af5019b

NNew autoreload GIF in apireference.xml.

  • Participants
  • Parent commits df70607

Comments (0)

Files changed (3)

File docs/book/xml/apireference.xml

             <para>You can profile any of your page handlers (exposed methods) as follows:</para>
             <example>
                 <title>Profiling example</title>
-                <para>
-                    <code>from cherrypy.lib import profile class Root: p =
-                    profile.Profiler("/path/to/profile/dir") def index(self): self.p.run(self._index)
-                    index.exposed = True def _index(self): return "Hello, world!" cherrypy.root =
-                    Root()</code>
-                    
-                </para>
+                <programlisting><code>from cherrypy.lib import profile
+
+class Root:
+    p = profile.Profiler("/path/to/profile/dir")
+    
+    def index(self):
+        self.p.run(self._index)
+    index.exposed = True
+    
+    def _index(self):
+        return "Hello, world!"
+
+cherrypy.root = Root()</code></programlisting>
             </example>
             <para>Set the config entry: "profiling.on = True" if you'd rather turn on profiling for
             all requests. Then, use the serve() function to browse the results in a web browser. If
             Python, not C). You can profile the test suite by supplying the --profile option to
             test.py.</para>
         </section>
+        <section>
+            <title>cherrypy.lib.autoreload</title>
+            <para>This module provides a brute-force method of reloading application files on the
+            fly. When the config entry "autoreload.on" is True (or when "server.environment" is
+            "development"), CherryPy uses the autoreload module to restart the current process
+            whenever one of the files in use is changed. The mechanism by which it does so is pretty
+            complicated:<figure>
+                    <title>The autoreload process</title>
+                    <mediaobject>
+                        <imageobject>
+                            <imagedata fileref="autoreload.gif" format="GIF" />
+                        </imageobject>
+                    </mediaobject>
+                </figure></para>
+        </section>
     </section>
     <section id="specialfunctions">
         <title>Special functions and attributes</title>

File docs/book/xml/autoreload.gif

Added
New image

File docs/book/xml/gettingstarted.xml

-<?xml version="1.0" encoding="UTF-8"?>
-<chapter xmlns:db="http://docbook.org/docbook-ng" xmlns:xi="http://www.w3.org/2001/XInclude"
-         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:id="gettingstarted">
-    <title>Getting started</title>
-    <section>
-        <abstract>
-            <para>Since CherryPy is pure Python and has no dependencies, obtaining and installing it
-            is a snap. You can install using a release package, or by using Subversion.</para>
-        </abstract>
-        <title>Installing CherryPy from a release package</title>
-        <section>
-            <title>Obtaining a release package</title>
-            <para>A "release package" is an official stable release of CherryPy. It means that the
-            main features and issues that were decided to be integrated and fixed for a particular
-            milestone, have been.</para>
-            <para>The latest package is available from <ulink
-            url="http://sourceforge.net/project/showfiles.php?group_id=56099">the sourceforge
-            repository</ulink> of the CherryPy project. You need to pick up the latest version of the
-            package.</para>
-        </section>
-        <section>
-            <title>Installing from a release package</title>
-            <para>Installing CherryPy from a release package will take three steps only. Type the
-            following commands :</para>
-            <cmdsynopsis>
-                <command>tar</command>
-                <arg choice="req">zxvf</arg>
-                <arg choice="req">CherryPy-2.1.0.tar.gz</arg>
-            </cmdsynopsis>
-            <para>Which will create the CherryPy-2.1.0 directory.</para>
-            <cmdsynopsis>
-                <command>cd</command>
-                <arg choice="req">CherryPy-2.1.0</arg>
-            </cmdsynopsis>
-            <para>Then issue the following command (if you are under Unix or Linux, you should be
-            root):</para>
-            <cmdsynopsis>
-                <command>python</command>
-                <arg choice="req">setup.py</arg>
-                <arg choice="req">install</arg>
-            </cmdsynopsis>
-        </section>
-    </section>
-    <section>
-        <title>Installing CherryPy from the Subversion repository</title>
-        <section>
-            <title>Obtaining the package from the Subversion repository</title>
-            <para>The CherryPy project uses Subversion to control access to its source code. Getting
-            CherryPy from the latest changeset is sometimes required because a bugfix or a feature is
-            only available from it. Keep in mind that subversion code is subject to change on a
-            regular basis; therefore, only use it if you know what you are doing.</para>
-            <para>To get the latest source code from the subversion repository, you first need to
-            install a SVN client. On Microsoft Windows, <ulink
-            url="http://tortoisesvn.tigris.org/">TortoiseSVN</ulink> is a good choice. Under Linux,
-            you can either use the <ulink url="http://subversion.tigris.org/">svn</ulink> command
-            line tools or use a graphical user interface such as <ulink
-            url="http://esvn.umputun.com/">eSVN</ulink>.</para>
-            <para>Once you have installed a svn client, you need to type the following command
-            :</para>
-            <cmdsynopsis>
-                <command>svn</command>
-                <arg choice="req">co</arg>
-                <arg choice="req">http://svn.cherrypy.org</arg>
-            </cmdsynopsis>
-            <para>This will download the complete source code to your computer.</para>
-        </section>
-        <section>
-            <title>Installing the package from the Subversion repository</title>
-            <para>If you have downloaded the source code from the CherryPy subversion repository,
-            then you should have a directory called svn.cherrypy.org. Then type the following
-            commands:</para>
-            <cmdsynopsis>
-                <command>cd</command>
-                <arg choice="req">svn.cherrypy.org/trunk</arg>
-            </cmdsynopsis>
-            <para>Then issue the following command (as root if you are under Unix/Linux):</para>
-            <cmdsynopsis>
-                <command>python</command>
-                <arg choice="req">setup.py</arg>
-                <arg choice="req">install</arg>
-            </cmdsynopsis>
-            <para>Alternately, since CherryPy has no dependencies, you don't have to run setup.py.
-            Simply checkout the code into a directory which is on your Python path, such as your
-            site-packages directory.
-            </para>
-        </section>
-    </section>
-    <section>
-        <title>Running the test programs</title>
-        <para>If you have installed CherryPy from the source code downloaded from the subversion
-        repository, you can run the test suite to check if everything is fine on your system. Type
-        the following commands:</para>
-        <cmdsynopsis>
-            <command>cd</command>
-            <arg choice="req">svn.cherrypy.org/trunk/cherrypy/test</arg>
-        </cmdsynopsis>
-        <cmdsynopsis>
-            <command>python</command>
-            <arg choice="req">test.py</arg>
-        </cmdsynopsis>
-        <para>If all tests pass, then they will be flagged as <code>ok</code>. If an error occurs,
-        please visit the main CherryPy website to report the issue.</para>
-    </section>
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter xmlns:db="http://docbook.org/docbook-ng" xmlns:xi="http://www.w3.org/2001/XInclude"
+         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:id="gettingstarted">
+    <title>Getting started</title>
+    <section>
+        <abstract>
+            <para>Since CherryPy is pure Python and has no dependencies, obtaining and installing it
+            is a snap. You can install using a release package, or by using Subversion.</para>
+        </abstract>
+        <title>Installing CherryPy from a release package</title>
+        <section>
+            <title>Obtaining a release package</title>
+            <para>A "release package" is an official stable release of CherryPy. It means that the
+            main features and issues that were decided to be integrated and fixed for a particular
+            milestone, have been.</para>
+            <para>The latest package is available from <ulink
+            url="http://sourceforge.net/project/showfiles.php?group_id=56099">the sourceforge
+            repository</ulink> of the CherryPy project. You need to pick up the latest version of the
+            package.</para>
+        </section>
+        <section>
+            <title>Installing from a release package</title>
+            <para>Installing CherryPy from a release package will take three steps only. Type the
+            following commands :</para>
+            <cmdsynopsis>
+                <command>tar</command>
+                <arg choice="req">zxvf</arg>
+                <arg choice="req">CherryPy-2.1.0.tar.gz</arg>
+            </cmdsynopsis>
+            <para>Which will create the CherryPy-2.1.0 directory.</para>
+            <cmdsynopsis>
+                <command>cd</command>
+                <arg choice="req">CherryPy-2.1.0</arg>
+            </cmdsynopsis>
+            <para>Then issue the following command (if you are under Unix or Linux, you should be
+            root):</para>
+            <cmdsynopsis>
+                <command>python</command>
+                <arg choice="req">setup.py</arg>
+                <arg choice="req">install</arg>
+            </cmdsynopsis>
+        </section>
+    </section>
+    <section>
+        <title>Installing CherryPy from the Subversion repository</title>
+        <section>
+            <title>Obtaining the package from the Subversion repository</title>
+            <para>The CherryPy project uses Subversion to control access to its source code. Getting
+            CherryPy from the latest changeset is sometimes required because a bugfix or a feature is
+            only available from it. Keep in mind that subversion code is subject to change on a
+            regular basis; therefore, only use it if you know what you are doing.</para>
+            <para>To get the latest source code from the subversion repository, you first need to
+            install a SVN client. On Microsoft Windows, <ulink
+            url="http://tortoisesvn.tigris.org/">TortoiseSVN</ulink> is a good choice. Under Linux,
+            you can either use the <ulink url="http://subversion.tigris.org/">svn</ulink> command
+            line tools or use a graphical user interface such as <ulink
+            url="http://esvn.umputun.com/">eSVN</ulink>.</para>
+            <para>Once you have installed a svn client, you need to type the following command
+            :</para>
+            <cmdsynopsis>
+                <command>svn</command>
+                <arg choice="req">co</arg>
+                <arg choice="req">http://svn.cherrypy.org</arg>
+            </cmdsynopsis>
+            <para>This will download the complete source code to your computer.</para>
+        </section>
+        <section>
+            <title>Installing the package from the Subversion repository</title>
+            <para>If you have downloaded the source code from the CherryPy subversion repository,
+            then you should have a directory called svn.cherrypy.org. Then type the following
+            commands:</para>
+            <cmdsynopsis>
+                <command>cd</command>
+                <arg choice="req">svn.cherrypy.org/trunk</arg>
+            </cmdsynopsis>
+            <para>Then issue the following command (as root if you are under Unix/Linux):</para>
+            <cmdsynopsis>
+                <command>python</command>
+                <arg choice="req">setup.py</arg>
+                <arg choice="req">install</arg>
+            </cmdsynopsis>
+            <para>Alternately, since CherryPy has no dependencies, you don't have to run setup.py.
+            Simply checkout the code into a directory which is on your Python path, such as your
+            site-packages directory.
+            </para>
+        </section>
+    </section>
+    <section>
+        <title>Running the test programs</title>
+        <para>If you have installed CherryPy from the source code downloaded from the subversion
+        repository, you can run the test suite to check if everything is fine on your system. Type
+        the following commands:</para>
+        <cmdsynopsis>
+            <command>cd</command>
+            <arg choice="req">svn.cherrypy.org/trunk/cherrypy/test</arg>
+        </cmdsynopsis>
+        <cmdsynopsis>
+            <command>python</command>
+            <arg choice="req">test.py</arg>
+        </cmdsynopsis>
+        <para>If all tests pass, then they will be flagged as <code>ok</code>. If an error occurs,
+        please visit the main CherryPy website to report the issue.</para>
+    </section>
 </chapter>