Re: Delivery Status Notification (Failure)

Johan Hartzenberg <[email protected]> Fri, 17 Mar 2017 06:32:02 -0700 (PDT)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
>
> [snip]
>
> class StringGenerator(object):
>    @cherrypy.expose
>    def index(self):
>      return open('index.html')
>
>
> @cherrypy.expose
> class StringGeneratorWebService(object):
>
>   @cherrypy.tools.accept(media='text/plain')
>   def GET(self):
>     with sqlite3.connect(DB_STRING) as c:
>      cherrypy.session['ts'] = time.time()
>      r = c.execute("SELECT value FROM user_string WHERE session_id=?",
>              [cherrypy.session.id])
>     return r.fetchone()
> [snip]
>
>
@expose goes with the route handler function you want to expose, not with 
the class.  So that looks like a mistake in the example?


-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.