/opt/imh-python/lib/python3.9/site-packages/cherrypy/tutorial
NameSizeModeActions
__pycache__/-0755rm
custom_error.html4040644editdlrm
pdf_file.pdf856980644editdlrm
README.rst6170644editdlrm
tut01_helloworld.py10150644editdlrm
tut02_expose_methods.py8010644editdlrm
tut03_get_and_post.py15870644editdlrm
tut04_complex_site.py29480644editdlrm
tut05_derived_objects.py21410644editdlrm
tut06_default_method.py22640644editdlrm
tut07_sessions.py12280644editdlrm
tut08_generators_and_yield.py12880644editdlrm
tut09_files.py34630644editdlrm
tut10_http_errors.py27060644editdlrm
tutorial.conf960644editdlrm
__init__.py850644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/cherrypy/tutorial/tut02_expose_methods.py (801B)
""" Tutorial - Multiple methods This tutorial shows you how to link to other methods of your request handler. """ import os.path import cherrypy class HelloWorld: @cherrypy.expose def index(self): # Let's link to another method here. return 'We have an important message for you!' @cherrypy.expose def show_msg(self): # Here's the important message! return 'Hello world!' tutconf = os.path.join(os.path.dirname(__file__), 'tutorial.conf') if __name__ == '__main__': # CherryPy always starts with app.root when trying to map request URIs # to objects, so we need to mount a request handler root. A request # to '/' will be mapped to HelloWorld().index(). cherrypy.quickstart(HelloWorld(), config=tutconf)