/usr/share/pyshared/zope/app/server/wsgi.py is in python-zope.app.server 3.6.0-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""WSGI-compliant HTTP server setup.
"""
__docformat__ = "reStructuredText"
import zope.interface
from zope.server.http.commonaccesslogger import CommonAccessLogger
from zope.server.http import wsgihttpserver
from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
from zope.app.wsgi import WSGIPublisherApplication
import servertype
class ServerType(object):
zope.interface.implements(servertype.IServerType)
def __init__(self, factory, applicationFactory, logFactory,
defaultPort, defaultVerbose, defaultIP='',
requestFactory=HTTPPublicationRequestFactory):
self._factory = factory
self._applicationFactory = applicationFactory
self._requestFactory = requestFactory
self._logFactory = logFactory
self._defaultPort = defaultPort
self._defaultVerbose = defaultVerbose
self._defaultIP = defaultIP
def create(self, name, task_dispatcher, db, port=None,
verbose=None, ip=None):
'See IServerType'
application = self._applicationFactory(
db, factory=self._requestFactory)
if port is None:
port = self._defaultPort
if ip is None:
ip = self._defaultIP
if verbose is None:
verbose = self._defaultVerbose
return self._factory(application, name, ip, port,
task_dispatcher=task_dispatcher,
verbose=verbose,
hit_log=self._logFactory(),
)
http = ServerType(wsgihttpserver.WSGIHTTPServer,
WSGIPublisherApplication,
CommonAccessLogger,
8080, True)
pmhttp = ServerType(wsgihttpserver.PMDBWSGIHTTPServer,
WSGIPublisherApplication,
CommonAccessLogger,
8013, True)
|