Skip to content

Commit 99132af

Browse files
author
alexandre.vassalotti
committed
Updated all import statements to use the new socketserver module name.
Renamed socketserver module in its own documentation. Renamed documentation references. git-svn-id: http://svn.python.org/projects/python/trunk@63132 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent ef5255b commit 99132af

14 files changed

Lines changed: 61 additions & 64 deletions

Doc/library/basehttpserver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Usually, this module isn't used directly, but is used as a basis for building
2121
functioning Web servers. See the :mod:`SimpleHTTPServer` and
2222
:mod:`CGIHTTPServer` modules.
2323

24-
The first class, :class:`HTTPServer`, is a :class:`SocketServer.TCPServer`
24+
The first class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer`
2525
subclass. It creates and listens at the HTTP socket, dispatching the requests
2626
to a handler. Code to create and run the server looks like this::
2727

Doc/library/logging.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,17 +1299,17 @@ the receiving end. A simple way of doing this is attaching a
12991299
logger2.warning('Jail zesty vixen who grabbed pay from quack.')
13001300
logger2.error('The five boxing wizards jump quickly.')
13011301

1302-
At the receiving end, you can set up a receiver using the :mod:`SocketServer`
1302+
At the receiving end, you can set up a receiver using the :mod:`socketserver`
13031303
module. Here is a basic working example::
13041304

13051305
import cPickle
13061306
import logging
13071307
import logging.handlers
1308-
import SocketServer
1308+
import socketserver
13091309
import struct
13101310

13111311

1312-
class LogRecordStreamHandler(SocketServer.StreamRequestHandler):
1312+
class LogRecordStreamHandler(socketserver.StreamRequestHandler):
13131313
"""Handler for a streaming logging request.
13141314

13151315
This basically logs the record using whatever logging policy is
@@ -1351,7 +1351,7 @@ module. Here is a basic working example::
13511351
# cycles and network bandwidth!
13521352
logger.handle(record)
13531353

1354-
class LogRecordSocketReceiver(SocketServer.ThreadingTCPServer):
1354+
class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):
13551355
"""simple TCP socket-based logging receiver suitable for testing.
13561356
"""
13571357

@@ -1360,7 +1360,7 @@ module. Here is a basic working example::
13601360
def __init__(self, host='localhost',
13611361
port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
13621362
handler=LogRecordStreamHandler):
1363-
SocketServer.ThreadingTCPServer.__init__(self, (host, port), handler)
1363+
socketserver.ThreadingTCPServer.__init__(self, (host, port), handler)
13641364
self.abort = 0
13651365
self.timeout = 1
13661366
self.logname = None

Doc/library/simplexmlrpcserver.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ XML-RPC servers written in Python. Servers can either be free standing, using
2222
functions that can be called by the XML-RPC protocol. The *requestHandler*
2323
parameter should be a factory for request handler instances; it defaults to
2424
:class:`SimpleXMLRPCRequestHandler`. The *addr* and *requestHandler* parameters
25-
are passed to the :class:`SocketServer.TCPServer` constructor. If *logRequests*
25+
are passed to the :class:`socketserver.TCPServer` constructor. If *logRequests*
2626
is true (the default), requests will be logged; setting this parameter to false
2727
will turn off logging. The *allow_none* and *encoding* parameters are passed
2828
on to :mod:`xmlrpclib` and control the XML-RPC responses that will be returned
@@ -63,7 +63,7 @@ SimpleXMLRPCServer Objects
6363
--------------------------
6464

6565
The :class:`SimpleXMLRPCServer` class is based on
66-
:class:`SocketServer.TCPServer` and provides a means of creating simple, stand
66+
:class:`socketserver.TCPServer` and provides a means of creating simple, stand
6767
alone XML-RPC servers.
6868

6969

Doc/library/socket.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ The module :mod:`socket` exports the following constants and functions:
481481

482482
.. seealso::
483483

484-
Module :mod:`SocketServer`
484+
Module :mod:`socketserver`
485485
Classes that simplify writing network servers.
486486

487487

Doc/library/socketserver.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11

2-
:mod:`SocketServer` --- A framework for network servers
2+
:mod:`socketserver` --- A framework for network servers
33
=======================================================
44

5-
.. module:: SocketServer
5+
.. module:: socketserver
66
:synopsis: A framework for network servers.
77

8-
9-
The :mod:`SocketServer` module simplifies the task of writing network servers.
8+
The :mod:`socketserver` module simplifies the task of writing network servers.
109

1110
There are four basic server classes: :class:`TCPServer` uses the Internet TCP
1211
protocol, which provides for continuous streams of data between the client and
@@ -213,7 +212,7 @@ server classes like :class:`TCPServer`; these methods aren't useful to external
213212
users of the server object.
214213

215214
.. XXX should the default implementations of these be documented, or should
216-
it be assumed that the user will look at SocketServer.py?
215+
it be assumed that the user will look at socketserver.py?
217216
218217
219218
.. function:: finish_request()

Lib/BaseHTTPServer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
import time
7575
import socket # For gethostbyaddr()
7676
import mimetools
77-
import SocketServer
77+
import socketserver
7878

7979
# Default error message template
8080
DEFAULT_ERROR_MESSAGE = """\
@@ -94,19 +94,19 @@
9494
def _quote_html(html):
9595
return html.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
9696

97-
class HTTPServer(SocketServer.TCPServer):
97+
class HTTPServer(socketserver.TCPServer):
9898

9999
allow_reuse_address = 1 # Seems to make sense in testing environment
100100

101101
def server_bind(self):
102102
"""Override server_bind to store the server name."""
103-
SocketServer.TCPServer.server_bind(self)
103+
socketserver.TCPServer.server_bind(self)
104104
host, port = self.socket.getsockname()[:2]
105105
self.server_name = socket.getfqdn(host)
106106
self.server_port = port
107107

108108

109-
class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
109+
class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
110110

111111
"""HTTP request handler base class.
112112

Lib/SimpleXMLRPCServer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def export_add(self, x, y):
101101

102102
import xmlrpclib
103103
from xmlrpclib import Fault
104-
import SocketServer
104+
import socketserver
105105
import BaseHTTPServer
106106
import sys
107107
import os
@@ -512,7 +512,7 @@ def log_request(self, code='-', size='-'):
512512
if self.server.logRequests:
513513
BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size)
514514

515-
class SimpleXMLRPCServer(SocketServer.TCPServer,
515+
class SimpleXMLRPCServer(socketserver.TCPServer,
516516
SimpleXMLRPCDispatcher):
517517
"""Simple XML-RPC server.
518518
@@ -536,7 +536,7 @@ def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
536536
self.logRequests = logRequests
537537

538538
SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
539-
SocketServer.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
539+
socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
540540

541541
# [Bug #1222790] If possible, set close-on-exec flag; if a
542542
# method spawns a subprocess, the subprocess shouldn't have

Lib/idlelib/rpc.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
has only one client per server, this was not a limitation.
66
77
+---------------------------------+ +-------------+
8-
| SocketServer.BaseRequestHandler | | SocketIO |
8+
| socketserver.BaseRequestHandler | | SocketIO |
99
+---------------------------------+ +-------------+
1010
^ | register() |
1111
| | unregister()|
@@ -31,7 +31,7 @@
3131
import os
3232
import socket
3333
import select
34-
import SocketServer
34+
import socketserver
3535
import struct
3636
import cPickle as pickle
3737
import threading
@@ -66,12 +66,12 @@ def pickle_code(co):
6666
BUFSIZE = 8*1024
6767
LOCALHOST = '127.0.0.1'
6868

69-
class RPCServer(SocketServer.TCPServer):
69+
class RPCServer(socketserver.TCPServer):
7070

7171
def __init__(self, addr, handlerclass=None):
7272
if handlerclass is None:
7373
handlerclass = RPCHandler
74-
SocketServer.TCPServer.__init__(self, addr, handlerclass)
74+
socketserver.TCPServer.__init__(self, addr, handlerclass)
7575

7676
def server_bind(self):
7777
"Override TCPServer method, no bind() phase for connecting entity"
@@ -492,18 +492,18 @@ class RemoteProxy(object):
492492
def __init__(self, oid):
493493
self.oid = oid
494494

495-
class RPCHandler(SocketServer.BaseRequestHandler, SocketIO):
495+
class RPCHandler(socketserver.BaseRequestHandler, SocketIO):
496496

497497
debugging = False
498498
location = "#S" # Server
499499

500500
def __init__(self, sock, addr, svr):
501501
svr.current_handler = self ## cgt xxx
502502
SocketIO.__init__(self, sock)
503-
SocketServer.BaseRequestHandler.__init__(self, sock, addr, svr)
503+
socketserver.BaseRequestHandler.__init__(self, sock, addr, svr)
504504

505505
def handle(self):
506-
"handle() method required by SocketServer"
506+
"handle() method required by socketserver"
507507
self.mainloop()
508508

509509
def get_remote_proxy(self, oid):

Lib/logging/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
except ImportError:
3636
thread = None
3737

38-
from SocketServer import ThreadingTCPServer, StreamRequestHandler
38+
from socketserver import ThreadingTCPServer, StreamRequestHandler
3939

4040

4141
DEFAULT_LOGGING_CONFIG_PORT = 9030

Lib/test/test___all__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_all(self):
4242
self.check_all("MimeWriter")
4343
self.check_all("Queue")
4444
self.check_all("SimpleHTTPServer")
45-
self.check_all("SocketServer")
45+
self.check_all("socketserver")
4646
self.check_all("StringIO")
4747
self.check_all("UserString")
4848
self.check_all("aifc")

0 commit comments

Comments
 (0)