home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1482 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  1.8 KB  |  33 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import cherrypy
  5. from cherrypy import tools, url
  6. import os
  7. local_dir = os.path.join(os.getcwd(), os.path.dirname(__file__))
  8.  
  9. class Root:
  10.     _cp_config = {
  11.         'tools.log_tracebacks.on': True }
  12.     
  13.     def index(self):
  14.         return "<html>\n<body>Try some <a href='%s?a=7'>other</a> path,\nor a <a href='%s?n=14'>default</a> path.<br />\nOr, just look at the pretty picture:<br />\n<img src='%s' />\n</body></html>" % (url('other'), url('else'), url('files/made_with_cherrypy_small.png'))
  15.  
  16.     index.exposed = True
  17.     
  18.     def default(self, *args, **kwargs):
  19.         return 'args: %s kwargs: %s' % (args, kwargs)
  20.  
  21.     default.exposed = True
  22.     
  23.     def other(self, a = 2, b = 'bananas', c = None):
  24.         cherrypy.response.headers['Content-Type'] = 'text/plain'
  25.         if c is None:
  26.             return 'Have %d %s.' % (int(a), b)
  27.         return 'Have %d %s, %s.' % (int(a), b, c)
  28.  
  29.     other.exposed = True
  30.     files = cherrypy.tools.staticdir.handler(section = '/files', dir = os.path.join(local_dir, 'static'), match = '\\.(css|gif|html?|ico|jpe?g|js|png|swf|xml)$')
  31.  
  32. root = Root()
  33.