summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-05-12 02:31:37 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-05-12 02:31:37 (GMT)
commitce261952e640b2d09ada1b160f0cfa37db32f928 (patch)
tree17b1c2129377435cbaf0169f702b78a61407b90f /Lib
parent6f1e619b414a93084efbb7244034a3546899fa4b (diff)
downloadcpython-ce261952e640b2d09ada1b160f0cfa37db32f928.zip
cpython-ce261952e640b2d09ada1b160f0cfa37db32f928.tar.gz
cpython-ce261952e640b2d09ada1b160f0cfa37db32f928.tar.bz2
Renamed the SocketServer module to 'socketserver'.
Merged revisions 63132 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r63132 | alexandre.vassalotti | 2008-05-11 22:11:22 -0400 (Sun, 11 May 2008) | 4 lines Updated all import statements to use the new socketserver module name. Renamed socketserver module in its own documentation. Renamed documentation references. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/BaseHTTPServer.py8
-rw-r--r--Lib/SimpleXMLRPCServer.py6
-rw-r--r--Lib/idlelib/rpc.py14
-rw-r--r--Lib/logging/config.py2
-rw-r--r--Lib/socketserver.py (renamed from Lib/SocketServer.py)0
-rw-r--r--Lib/test/test___all__.py2
-rw-r--r--Lib/test/test_logging.py2
-rw-r--r--Lib/test/test_socketserver.py58
-rwxr-xr-xLib/test/test_wsgiref.py2
9 files changed, 47 insertions, 47 deletions
diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py
index fbb8108..8a099fe 100644
--- a/Lib/BaseHTTPServer.py
+++ b/Lib/BaseHTTPServer.py
@@ -75,7 +75,7 @@ import sys
import time
import socket # For gethostbyaddr()
import mimetools
-import SocketServer
+import socketserver
# Default error message template
DEFAULT_ERROR_MESSAGE = """\
@@ -95,19 +95,19 @@ DEFAULT_ERROR_CONTENT_TYPE = "text/html;charset=utf-8"
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.
diff --git a/Lib/SimpleXMLRPCServer.py b/Lib/SimpleXMLRPCServer.py
index 5736258..a985153 100644
--- a/Lib/SimpleXMLRPCServer.py
+++ b/Lib/SimpleXMLRPCServer.py
@@ -100,7 +100,7 @@ server.handle_request()
import xmlrpclib
from xmlrpclib import Fault
-import SocketServer
+import socketserver
import BaseHTTPServer
import sys
import os
@@ -494,7 +494,7 @@ class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
if self.server.logRequests:
BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size)
-class SimpleXMLRPCServer(SocketServer.TCPServer,
+class SimpleXMLRPCServer(socketserver.TCPServer,
SimpleXMLRPCDispatcher):
"""Simple XML-RPC server.
@@ -518,7 +518,7 @@ class SimpleXMLRPCServer(SocketServer.TCPServer,
self.logRequests = logRequests
SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
- SocketServer.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
+ socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
# [Bug #1222790] If possible, set close-on-exec flag; if a
# method spawns a subprocess, the subprocess shouldn't have
diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py
index 13ef372..e555ffb 100644
--- a/Lib/idlelib/rpc.py
+++ b/Lib/idlelib/rpc.py
@@ -5,7 +5,7 @@ connect to the Idle process, which listens for the connection. Since Idle has
has only one client per server, this was not a limitation.
+---------------------------------+ +-------------+
- | SocketServer.BaseRequestHandler | | SocketIO |
+ | socketserver.BaseRequestHandler | | SocketIO |
+---------------------------------+ +-------------+
^ | register() |
| | unregister()|
@@ -31,7 +31,7 @@ import sys
import os
import socket
import select
-import SocketServer
+import socketserver
import struct
import pickle
import threading
@@ -66,12 +66,12 @@ copyreg.pickle(types.CodeType, pickle_code, unpickle_code)
BUFSIZE = 8*1024
LOCALHOST = '127.0.0.1'
-class RPCServer(SocketServer.TCPServer):
+class RPCServer(socketserver.TCPServer):
def __init__(self, addr, handlerclass=None):
if handlerclass is None:
handlerclass = RPCHandler
- SocketServer.TCPServer.__init__(self, addr, handlerclass)
+ socketserver.TCPServer.__init__(self, addr, handlerclass)
def server_bind(self):
"Override TCPServer method, no bind() phase for connecting entity"
@@ -492,7 +492,7 @@ class RemoteProxy(object):
def __init__(self, oid):
self.oid = oid
-class RPCHandler(SocketServer.BaseRequestHandler, SocketIO):
+class RPCHandler(socketserver.BaseRequestHandler, SocketIO):
debugging = False
location = "#S" # Server
@@ -500,10 +500,10 @@ class RPCHandler(SocketServer.BaseRequestHandler, SocketIO):
def __init__(self, sock, addr, svr):
svr.current_handler = self ## cgt xxx
SocketIO.__init__(self, sock)
- SocketServer.BaseRequestHandler.__init__(self, sock, addr, svr)
+ socketserver.BaseRequestHandler.__init__(self, sock, addr, svr)
def handle(self):
- "handle() method required by SocketServer"
+ "handle() method required by socketserver"
self.mainloop()
def get_remote_proxy(self, oid):
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index fd6caaa..172f069 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -32,7 +32,7 @@ try:
except ImportError:
thread = None
-from SocketServer import ThreadingTCPServer, StreamRequestHandler
+from socketserver import ThreadingTCPServer, StreamRequestHandler
DEFAULT_LOGGING_CONFIG_PORT = 9030
diff --git a/Lib/SocketServer.py b/Lib/socketserver.py
index 2a9ec8a..2a9ec8a 100644
--- a/Lib/SocketServer.py
+++ b/Lib/socketserver.py
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 57d89e0..ab8480f 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -38,7 +38,7 @@ class AllTest(unittest.TestCase):
self.check_all("Cookie")
self.check_all("Queue")
self.check_all("SimpleHTTPServer")
- self.check_all("SocketServer")
+ self.check_all("socketserver")
self.check_all("aifc")
self.check_all("base64")
self.check_all("bdb")
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 6f5af15..b6da0ae 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -33,7 +33,7 @@ import os
import re
import select
import socket
-from SocketServer import ThreadingTCPServer, StreamRequestHandler
+from socketserver import ThreadingTCPServer, StreamRequestHandler
import string
import struct
import sys
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index 3946078..b6bb0f7 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -1,5 +1,5 @@
"""
-Test suite for SocketServer.py.
+Test suite for socketserver.
"""
import contextlib
@@ -13,7 +13,7 @@ import tempfile
import threading
import time
import unittest
-import SocketServer
+import socketserver
import test.test_support
from test.test_support import reap_children, verbose, TestSkipped
@@ -40,12 +40,12 @@ def receive(sock, n, timeout=20):
raise RuntimeError("timed out on %r" % (sock,))
if HAVE_UNIX_SOCKETS:
- class ForkingUnixStreamServer(SocketServer.ForkingMixIn,
- SocketServer.UnixStreamServer):
+ class ForkingUnixStreamServer(socketserver.ForkingMixIn,
+ socketserver.UnixStreamServer):
pass
- class ForkingUnixDatagramServer(SocketServer.ForkingMixIn,
- SocketServer.UnixDatagramServer):
+ class ForkingUnixDatagramServer(socketserver.ForkingMixIn,
+ socketserver.UnixDatagramServer):
pass
@@ -172,55 +172,55 @@ class SocketServerTest(unittest.TestCase):
s.close()
def test_TCPServer(self):
- self.run_server(SocketServer.TCPServer,
- SocketServer.StreamRequestHandler,
+ self.run_server(socketserver.TCPServer,
+ socketserver.StreamRequestHandler,
self.stream_examine)
def test_ThreadingTCPServer(self):
- self.run_server(SocketServer.ThreadingTCPServer,
- SocketServer.StreamRequestHandler,
+ self.run_server(socketserver.ThreadingTCPServer,
+ socketserver.StreamRequestHandler,
self.stream_examine)
if HAVE_FORKING:
def test_ForkingTCPServer(self):
with simple_subprocess(self):
- self.run_server(SocketServer.ForkingTCPServer,
- SocketServer.StreamRequestHandler,
+ self.run_server(socketserver.ForkingTCPServer,
+ socketserver.StreamRequestHandler,
self.stream_examine)
if HAVE_UNIX_SOCKETS:
def test_UnixStreamServer(self):
- self.run_server(SocketServer.UnixStreamServer,
- SocketServer.StreamRequestHandler,
+ self.run_server(socketserver.UnixStreamServer,
+ socketserver.StreamRequestHandler,
self.stream_examine)
def test_ThreadingUnixStreamServer(self):
- self.run_server(SocketServer.ThreadingUnixStreamServer,
- SocketServer.StreamRequestHandler,
+ self.run_server(socketserver.ThreadingUnixStreamServer,
+ socketserver.StreamRequestHandler,
self.stream_examine)
if HAVE_FORKING:
def test_ForkingUnixStreamServer(self):
with simple_subprocess(self):
self.run_server(ForkingUnixStreamServer,
- SocketServer.StreamRequestHandler,
+ socketserver.StreamRequestHandler,
self.stream_examine)
def test_UDPServer(self):
- self.run_server(SocketServer.UDPServer,
- SocketServer.DatagramRequestHandler,
+ self.run_server(socketserver.UDPServer,
+ socketserver.DatagramRequestHandler,
self.dgram_examine)
def test_ThreadingUDPServer(self):
- self.run_server(SocketServer.ThreadingUDPServer,
- SocketServer.DatagramRequestHandler,
+ self.run_server(socketserver.ThreadingUDPServer,
+ socketserver.DatagramRequestHandler,
self.dgram_examine)
if HAVE_FORKING:
def test_ForkingUDPServer(self):
with simple_subprocess(self):
- self.run_server(SocketServer.ForkingUDPServer,
- SocketServer.DatagramRequestHandler,
+ self.run_server(socketserver.ForkingUDPServer,
+ socketserver.DatagramRequestHandler,
self.dgram_examine)
# Alas, on Linux (at least) recvfrom() doesn't return a meaningful
@@ -228,19 +228,19 @@ class SocketServerTest(unittest.TestCase):
# if HAVE_UNIX_SOCKETS:
# def test_UnixDatagramServer(self):
- # self.run_server(SocketServer.UnixDatagramServer,
- # SocketServer.DatagramRequestHandler,
+ # self.run_server(socketserver.UnixDatagramServer,
+ # socketserver.DatagramRequestHandler,
# self.dgram_examine)
#
# def test_ThreadingUnixDatagramServer(self):
- # self.run_server(SocketServer.ThreadingUnixDatagramServer,
- # SocketServer.DatagramRequestHandler,
+ # self.run_server(socketserver.ThreadingUnixDatagramServer,
+ # socketserver.DatagramRequestHandler,
# self.dgram_examine)
#
# if HAVE_FORKING:
# def test_ForkingUnixDatagramServer(self):
- # self.run_server(SocketServer.ForkingUnixDatagramServer,
- # SocketServer.DatagramRequestHandler,
+ # self.run_server(socketserver.ForkingUnixDatagramServer,
+ # socketserver.DatagramRequestHandler,
# self.dgram_examine)
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index c02f0af..a5e0b27 100755
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -8,7 +8,7 @@ from wsgiref.validate import validator
from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, demo_app
from wsgiref.simple_server import make_server
from io import StringIO, BytesIO, BufferedReader
-from SocketServer import BaseServer
+from socketserver import BaseServer
import re, sys
from test import test_support