summaryrefslogtreecommitdiff
path: root/cherrypy/tutorial
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2008-01-12 23:35:17 +0000
committerRobert Brewer <fumanchu@aminus.org>2008-01-12 23:35:17 +0000
commit020916d3704cb077365f35133919a30dbd4e4b0a (patch)
tree1ddaad8d96e247a5976fae10871590fb5fd64b06 /cherrypy/tutorial
parent6fb1d4ce5d16a38781a2d725cb235aba344eed94 (diff)
downloadcherrypy-git-020916d3704cb077365f35133919a30dbd4e4b0a.tar.gz
Fix for #756 (Deprecate server.quickstart):
* server.quickstart now does nothing but raise a warning. * Made 'root' argument to cherrypy.quickstart optional (to make tutorials easier, but it applies broadly). * Removed all calls to server.quickstart.
Diffstat (limited to 'cherrypy/tutorial')
-rw-r--r--cherrypy/tutorial/tut02_expose_methods.py6
-rw-r--r--cherrypy/tutorial/tut03_get_and_post.py6
-rw-r--r--cherrypy/tutorial/tut04_complex_site.py6
-rw-r--r--cherrypy/tutorial/tut05_derived_objects.py7
-rw-r--r--cherrypy/tutorial/tut06_default_method.py7
-rw-r--r--cherrypy/tutorial/tut07_sessions.py7
-rw-r--r--cherrypy/tutorial/tut08_generators_and_yield.py7
-rw-r--r--cherrypy/tutorial/tut09_files.py7
-rw-r--r--cherrypy/tutorial/tut10_http_errors.py8
9 files changed, 19 insertions, 42 deletions
diff --git a/cherrypy/tutorial/tut02_expose_methods.py b/cherrypy/tutorial/tut02_expose_methods.py
index 274a6546..6df2cd3f 100644
--- a/cherrypy/tutorial/tut02_expose_methods.py
+++ b/cherrypy/tutorial/tut02_expose_methods.py
@@ -23,8 +23,6 @@ cherrypy.tree.mount(HelloWorld())
if __name__ == '__main__':
import os.path
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))
diff --git a/cherrypy/tutorial/tut03_get_and_post.py b/cherrypy/tutorial/tut03_get_and_post.py
index 2b38877a..e30f44e4 100644
--- a/cherrypy/tutorial/tut03_get_and_post.py
+++ b/cherrypy/tutorial/tut03_get_and_post.py
@@ -45,7 +45,5 @@ cherrypy.tree.mount(WelcomePage())
if __name__ == '__main__':
import os.path
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))
diff --git a/cherrypy/tutorial/tut04_complex_site.py b/cherrypy/tutorial/tut04_complex_site.py
index 3d5a66fa..63e581b0 100644
--- a/cherrypy/tutorial/tut04_complex_site.py
+++ b/cherrypy/tutorial/tut04_complex_site.py
@@ -87,8 +87,6 @@ cherrypy.tree.mount(root)
if __name__ == '__main__':
import os.path
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))
diff --git a/cherrypy/tutorial/tut05_derived_objects.py b/cherrypy/tutorial/tut05_derived_objects.py
index c94935a6..9656ffe4 100644
--- a/cherrypy/tutorial/tut05_derived_objects.py
+++ b/cherrypy/tutorial/tut05_derived_objects.py
@@ -74,8 +74,5 @@ cherrypy.tree.mount(HomePage())
if __name__ == '__main__':
import os.path
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
-
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))
diff --git a/cherrypy/tutorial/tut06_default_method.py b/cherrypy/tutorial/tut06_default_method.py
index 66731cab..4ccc7330 100644
--- a/cherrypy/tutorial/tut06_default_method.py
+++ b/cherrypy/tutorial/tut06_default_method.py
@@ -55,8 +55,5 @@ cherrypy.tree.mount(UsersPage())
if __name__ == '__main__':
import os.path
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
-
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))
diff --git a/cherrypy/tutorial/tut07_sessions.py b/cherrypy/tutorial/tut07_sessions.py
index 8f4f2b1b..0c1e167c 100644
--- a/cherrypy/tutorial/tut07_sessions.py
+++ b/cherrypy/tutorial/tut07_sessions.py
@@ -35,8 +35,5 @@ cherrypy.tree.mount(HitCounter())
if __name__ == '__main__':
import os.path
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
-
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))
diff --git a/cherrypy/tutorial/tut08_generators_and_yield.py b/cherrypy/tutorial/tut08_generators_and_yield.py
index 1a3e3c43..c5be531f 100644
--- a/cherrypy/tutorial/tut08_generators_and_yield.py
+++ b/cherrypy/tutorial/tut08_generators_and_yield.py
@@ -37,8 +37,5 @@ cherrypy.tree.mount(GeneratorDemo())
if __name__ == '__main__':
import os.path
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
-
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))
diff --git a/cherrypy/tutorial/tut09_files.py b/cherrypy/tutorial/tut09_files.py
index b3f040f6..c12f9672 100644
--- a/cherrypy/tutorial/tut09_files.py
+++ b/cherrypy/tutorial/tut09_files.py
@@ -95,8 +95,5 @@ cherrypy.tree.mount(FileDemo())
if __name__ == '__main__':
import os.path
- # Start the CherryPy server.
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))
diff --git a/cherrypy/tutorial/tut10_http_errors.py b/cherrypy/tutorial/tut10_http_errors.py
index a64fbbed..9d1e2008 100644
--- a/cherrypy/tutorial/tut10_http_errors.py
+++ b/cherrypy/tutorial/tut10_http_errors.py
@@ -72,8 +72,6 @@ cherrypy.tree.mount(HTTPErrorDemo())
if __name__ == '__main__':
- # Start the CherryPy server.
- cherrypy.config.update(os.path.join(os.path.dirname(__file__), 'tutorial.conf'))
- cherrypy.server.quickstart()
- cherrypy.engine.start()
- cherrypy.engine.block()
+ import os.path
+ thisdir = os.path.dirname(__file__)
+ cherrypy.quickstart(config=os.path.join(thisdir, 'tutorial.conf'))