socketserver renaming reversal part 3: move the module into the right

place and fix all references to it.  Closes #2926.
This commit is contained in:
Georg Brandl 2008-05-24 18:31:28 +00:00
parent 6acb075f03
commit e152a77d96
19 changed files with 409 additions and 411 deletions

View file

@ -74,7 +74,7 @@ import sys
import time
import socket # For gethostbyaddr()
import mimetools
import socketserver
import SocketServer
# Default error message template
DEFAULT_ERROR_MESSAGE = """\
@ -94,19 +94,19 @@ DEFAULT_ERROR_CONTENT_TYPE = "text/html"
def _quote_html(html):
return html.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
class HTTPServer(socketserver.TCPServer):
class HTTPServer(SocketServer.TCPServer):
allow_reuse_address = 1 # Seems to make sense in testing environment
def server_bind(self):
"""Override server_bind to store the server name."""
socketserver.TCPServer.server_bind(self)
SocketServer.TCPServer.server_bind(self)
host, port = self.socket.getsockname()[:2]
self.server_name = socket.getfqdn(host)
self.server_port = port
class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
"""HTTP request handler base class.