Jater

__init__.py

Apr 23rd, 2015
236
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import cherrypy
  2.  
  3. class Server(object):
  4.     def __init__(self):
  5.         self.pageHtml = """<html><head><meta charset="utf-8"><title>%s</title></head><body>%s</body></html>"""
  6.  
  7.     @cherrypy.expose
  8.     def default(self, *args, **kwargs):
  9.         return self.pageHtml % ("Test page", "This is test page")
  10.        
  11.     @cherrypy.expose
  12.     def about(self, *args, **kwargs):
  13.         return self.pageHtml % ("About page", "This is about page")
  14.        
  15.     @cherrypy.expose
  16.     def pageone(self, *args, **kwargs):
  17.         return self.pageHtml % ("Pageone page", "This is pageone page")
RAW Paste Data