def create_wsgi_app(path_to_library=None, prefix='', virtual_library=None):
 from calibre.library import db
 cherrypy.config.update({'environment': 'embedded'})
 db = db(path_to_library)
 parser = option_parser()
 (opts, args) = parser.parse_args(['calibre-server'])
 opts.url_prefix = prefix
 opts.restriction = virtual_library
 server = LibraryServer(db, opts, wsgi=True, show_tracebacks=True)
 return cherrypy.Application(server, script_name=None, config=server.config)

def create_wsgi_app ( path_to_library = None , prefix = '' , virtual_library = None ) : from calibre . library import db cherrypy . config . update ( { 'environment' : 'embedded' } ) db = db ( path_to_library ) parser = option_parser ( ) ( opts , args ) = parser . parse_args ( [ 'calibre-server' ] ) opts . url_prefix = prefix opts . restriction = virtual_library server = LibraryServer ( db , opts , wsgi = True , show_tracebacks = True ) return cherrypy . Application ( server , script_name = None , config = server . config )
wsgi entry point .