Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e152a77d
Kaydet (Commit)
e152a77d
authored
May 24, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
socketserver renaming reversal part 3: move the module into the right
place and fix all references to it. Closes #2926.
üst
6acb075f
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
83 additions
and
85 deletions
+83
-85
basehttpserver.rst
Doc/library/basehttpserver.rst
+1
-1
logging.rst
Doc/library/logging.rst
+5
-5
repr.rst
Doc/library/repr.rst
+3
-2
simplexmlrpcserver.rst
Doc/library/simplexmlrpcserver.rst
+2
-2
socket.rst
Doc/library/socket.rst
+1
-1
socketserver.rst
Doc/library/socketserver.rst
+20
-21
2.6.rst
Doc/whatsnew/2.6.rst
+3
-1
BaseHTTPServer.py
Lib/BaseHTTPServer.py
+4
-4
SimpleXMLRPCServer.py
Lib/SimpleXMLRPCServer.py
+3
-3
SocketServer.py
Lib/SocketServer.py
+0
-0
rpc.py
Lib/idlelib/rpc.py
+7
-7
config.py
Lib/logging/config.py
+1
-1
test___all__.py
Lib/test/test___all__.py
+1
-1
test_logging.py
Lib/test/test_logging.py
+1
-1
test_py3kwarn.py
Lib/test/test_py3kwarn.py
+0
-1
test_socketserver.py
Lib/test/test_socketserver.py
+29
-29
test_wsgiref.py
Lib/test/test_wsgiref.py
+1
-1
NEWS
Misc/NEWS
+0
-3
cheatsheet
Misc/cheatsheet
+1
-1
No files found.
Doc/library/basehttpserver.rst
Dosyayı görüntüle @
e152a77d
...
@@ -21,7 +21,7 @@ Usually, this module isn't used directly, but is used as a basis for building
...
@@ -21,7 +21,7 @@ Usually, this module isn't used directly, but is used as a basis for building
functioning Web servers. See the :mod:`SimpleHTTPServer` and
functioning Web servers. See the :mod:`SimpleHTTPServer` and
:mod:`CGIHTTPServer` modules.
:mod:`CGIHTTPServer` modules.
The first class, :class:`HTTPServer`, is a :class:`
sockets
erver.TCPServer`
The first class, :class:`HTTPServer`, is a :class:`
SocketS
erver.TCPServer`
subclass. It creates and listens at the HTTP socket, dispatching the requests
subclass. It creates and listens at the HTTP socket, dispatching the requests
to a handler. Code to create and run the server looks like this::
to a handler. Code to create and run the server looks like this::
...
...
Doc/library/logging.rst
Dosyayı görüntüle @
e152a77d
...
@@ -1299,17 +1299,17 @@ the receiving end. A simple way of doing this is attaching a
...
@@ -1299,17 +1299,17 @@ the receiving end. A simple way of doing this is attaching a
logger2
.
warning
(
'Jail zesty vixen who grabbed pay from quack.'
)
logger2
.
warning
(
'Jail zesty vixen who grabbed pay from quack.'
)
logger2
.
error
(
'The five boxing wizards jump quickly.'
)
logger2
.
error
(
'The five boxing wizards jump quickly.'
)
At
the
receiving
end
,
you
can
set
up
a
receiver
using
the
:
mod
:`
sockets
erver
`
At
the
receiving
end
,
you
can
set
up
a
receiver
using
the
:
mod
:`
SocketS
erver
`
module
.
Here
is
a
basic
working
example
::
module
.
Here
is
a
basic
working
example
::
import
cPickle
import
cPickle
import
logging
import
logging
import
logging
.
handlers
import
logging
.
handlers
import
sockets
erver
import
SocketS
erver
import
struct
import
struct
class
LogRecordStreamHandler
(
sockets
erver
.
StreamRequestHandler
):
class
LogRecordStreamHandler
(
SocketS
erver
.
StreamRequestHandler
):
"""Handler for a streaming logging request.
"""Handler for a streaming logging request.
This basically logs the record using whatever logging policy is
This basically logs the record using whatever logging policy is
...
@@ -1351,7 +1351,7 @@ module. Here is a basic working example::
...
@@ -1351,7 +1351,7 @@ module. Here is a basic working example::
#
cycles
and
network
bandwidth
!
#
cycles
and
network
bandwidth
!
logger
.
handle
(
record
)
logger
.
handle
(
record
)
class
LogRecordSocketReceiver
(
sockets
erver
.
ThreadingTCPServer
):
class
LogRecordSocketReceiver
(
SocketS
erver
.
ThreadingTCPServer
):
"""simple TCP socket-based logging receiver suitable for testing.
"""simple TCP socket-based logging receiver suitable for testing.
"""
"""
...
@@ -1360,7 +1360,7 @@ module. Here is a basic working example::
...
@@ -1360,7 +1360,7 @@ module. Here is a basic working example::
def
__init__
(
self
,
host
=
'localhost'
,
def
__init__
(
self
,
host
=
'localhost'
,
port
=
logging
.
handlers
.
DEFAULT_TCP_LOGGING_PORT
,
port
=
logging
.
handlers
.
DEFAULT_TCP_LOGGING_PORT
,
handler
=
LogRecordStreamHandler
):
handler
=
LogRecordStreamHandler
):
sockets
erver
.
ThreadingTCPServer
.
__init__
(
self
,
(
host
,
port
),
handler
)
SocketS
erver
.
ThreadingTCPServer
.
__init__
(
self
,
(
host
,
port
),
handler
)
self
.
abort
=
0
self
.
abort
=
0
self
.
timeout
=
1
self
.
timeout
=
1
self
.
logname
=
None
self
.
logname
=
None
...
...
Doc/library/repr.rst
Dosyayı görüntüle @
e152a77d
...
@@ -7,8 +7,9 @@
...
@@ -7,8 +7,9 @@
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
.. note::
.. note::
The :mod:`repr` module has been renamed to :mod:`reprlib` in
The :mod:`repr` module has been renamed to :mod:`reprlib` in Python 3.0. The
Python 3.0.
:term:`2to3` tool will automatically adapt imports when converting your
sources to 3.0.
The :mod:`repr` module provides a means for producing object representations
The :mod:`repr` module provides a means for producing object representations
with limits on the size of the resulting strings. This is used in the Python
with limits on the size of the resulting strings. This is used in the Python
...
...
Doc/library/simplexmlrpcserver.rst
Dosyayı görüntüle @
e152a77d
...
@@ -22,7 +22,7 @@ XML-RPC servers written in Python. Servers can either be free standing, using
...
@@ -22,7 +22,7 @@ XML-RPC servers written in Python. Servers can either be free standing, using
functions that can be called by the XML-RPC protocol. The *requestHandler*
functions that can be called by the XML-RPC protocol. The *requestHandler*
parameter should be a factory for request handler instances; it defaults to
parameter should be a factory for request handler instances; it defaults to
:class:`SimpleXMLRPCRequestHandler`. The *addr* and *requestHandler* parameters
:class:`SimpleXMLRPCRequestHandler`. The *addr* and *requestHandler* parameters
are passed to the :class:`
sockets
erver.TCPServer` constructor. If *logRequests*
are passed to the :class:`
SocketS
erver.TCPServer` constructor. If *logRequests*
is true (the default), requests will be logged; setting this parameter to false
is true (the default), requests will be logged; setting this parameter to false
will turn off logging. The *allow_none* and *encoding* parameters are passed
will turn off logging. The *allow_none* and *encoding* parameters are passed
on to :mod:`xmlrpclib` and control the XML-RPC responses that will be returned
on to :mod:`xmlrpclib` and control the XML-RPC responses that will be returned
...
@@ -63,7 +63,7 @@ SimpleXMLRPCServer Objects
...
@@ -63,7 +63,7 @@ SimpleXMLRPCServer Objects
--------------------------
--------------------------
The :class:`SimpleXMLRPCServer` class is based on
The :class:`SimpleXMLRPCServer` class is based on
:class:`
sockets
erver.TCPServer` and provides a means of creating simple, stand
:class:`
SocketS
erver.TCPServer` and provides a means of creating simple, stand
alone XML-RPC servers.
alone XML-RPC servers.
...
...
Doc/library/socket.rst
Dosyayı görüntüle @
e152a77d
...
@@ -481,7 +481,7 @@ The module :mod:`socket` exports the following constants and functions:
...
@@ -481,7 +481,7 @@ The module :mod:`socket` exports the following constants and functions:
.. seealso::
.. seealso::
Module :mod:`
sockets
erver`
Module :mod:`
SocketS
erver`
Classes that simplify writing network servers.
Classes that simplify writing network servers.
...
...
Doc/library/socketserver.rst
Dosyayı görüntüle @
e152a77d
:mod:`socketserver` --- A framework for network servers
:mod:`SocketServer` --- A framework for network servers
=======================================================
=======================================================
.. module:: SocketServer
.. module:: SocketServer
:synopsis: Old name for the socketserver module.
.. module:: socketserver
:synopsis: A framework for network servers.
:synopsis: A framework for network servers.
.. note::
.. note::
The :mod:`SocketServer` module has been renamed to :mod:`socketserver` in
Python 3.0. It is importable under both names in Python 2.6 and the rest of
The :mod:`SocketServer` module has been renamed to `socketserver` in Python
the 2.x series.
3.0. The :term:`2to3` tool will automatically adapt imports when converting
your sources to 3.0.
The :mod:`
sockets
erver` module simplifies the task of writing network servers.
The :mod:`
SocketS
erver` module simplifies the task of writing network servers.
There are four basic server classes: :class:`TCPServer` uses the Internet TCP
There are four basic server classes: :class:`TCPServer` uses the Internet TCP
protocol, which provides for continuous streams of data between the client and
protocol, which provides for continuous streams of data between the client and
...
@@ -220,7 +219,7 @@ server classes like :class:`TCPServer`; these methods aren't useful to external
...
@@ -220,7 +219,7 @@ server classes like :class:`TCPServer`; these methods aren't useful to external
users of the server object.
users of the server object.
.. XXX should the default implementations of these be documented, or should
.. XXX should the default implementations of these be documented, or should
it be assumed that the user will look at
sockets
erver.py?
it be assumed that the user will look at
SocketS
erver.py?
.. function:: finish_request()
.. function:: finish_request()
...
@@ -325,14 +324,14 @@ request.
...
@@ -325,14 +324,14 @@ request.
Examples
Examples
--------
--------
:class:`
sockets
erver.TCPServer` Example
:class:`
SocketS
erver.TCPServer` Example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is the server side::
This is the server side::
import
sockets
erver
import
SocketS
erver
class MyTCPHandler(
sockets
erver.BaseRequestHandler):
class MyTCPHandler(
SocketS
erver.BaseRequestHandler):
"""
"""
The RequestHandler class for our server.
The RequestHandler class for our server.
...
@@ -353,7 +352,7 @@ This is the server side::
...
@@ -353,7 +352,7 @@ This is the server side::
HOST, PORT = "localhost", 9999
HOST, PORT = "localhost", 9999
# Create the server, binding to localhost on port 9999
# Create the server, binding to localhost on port 9999
server =
sockets
erver.TCPServer((HOST, PORT), MyTCPHandler)
server =
SocketS
erver.TCPServer((HOST, PORT), MyTCPHandler)
# Activate the server; this will keep running until you
# Activate the server; this will keep running until you
# interrupt the program with Ctrl-C
# interrupt the program with Ctrl-C
...
@@ -362,7 +361,7 @@ This is the server side::
...
@@ -362,7 +361,7 @@ This is the server side::
An alternative request handler class that makes use of streams (file-like
An alternative request handler class that makes use of streams (file-like
objects that simplify communication by providing the standard file interface)::
objects that simplify communication by providing the standard file interface)::
class MyTCPHandler(
sockets
erver.StreamRequestHandler):
class MyTCPHandler(
SocketS
erver.StreamRequestHandler):
def handle(self):
def handle(self):
# self.rfile is a file-like object created by the handler;
# self.rfile is a file-like object created by the handler;
...
@@ -423,14 +422,14 @@ Client::
...
@@ -423,14 +422,14 @@ Client::
Received: PYTHON IS NICE
Received: PYTHON IS NICE
:class:`
sockets
erver.UDPServer` Example
:class:`
SocketS
erver.UDPServer` Example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is the server side::
This is the server side::
import
sockets
erver
import
SocketS
erver
class MyUDPHandler(
sockets
erver.BaseRequestHandler):
class MyUDPHandler(
SocketS
erver.BaseRequestHandler):
"""
"""
This class works similar to the TCP handler class, except that
This class works similar to the TCP handler class, except that
self.request consists of a pair of data and client socket, and since
self.request consists of a pair of data and client socket, and since
...
@@ -447,7 +446,7 @@ This is the server side::
...
@@ -447,7 +446,7 @@ This is the server side::
if __name__ == "__main__":
if __name__ == "__main__":
HOST, PORT = "localhost", 9999
HOST, PORT = "localhost", 9999
server =
sockets
erver.UDPServer((HOST, PORT), BaseUDPRequestHandler)
server =
SocketS
erver.UDPServer((HOST, PORT), BaseUDPRequestHandler)
server.serve_forever()
server.serve_forever()
This is the client side::
This is the client side::
...
@@ -482,9 +481,9 @@ An example for the :class:`ThreadingMixIn` class::
...
@@ -482,9 +481,9 @@ An example for the :class:`ThreadingMixIn` class::
import socket
import socket
import threading
import threading
import
sockets
erver
import
SocketS
erver
class ThreadedTCPRequestHandler(
sockets
erver.BaseRequestHandler):
class ThreadedTCPRequestHandler(
SocketS
erver.BaseRequestHandler):
def handle(self):
def handle(self):
data = self.request.recv(1024)
data = self.request.recv(1024)
...
@@ -492,7 +491,7 @@ An example for the :class:`ThreadingMixIn` class::
...
@@ -492,7 +491,7 @@ An example for the :class:`ThreadingMixIn` class::
response = "%s: %s" % (cur_thread.getName(), data)
response = "%s: %s" % (cur_thread.getName(), data)
self.request.send(response)
self.request.send(response)
class ThreadedTCPServer(
socketserver.ThreadingMixIn, sockets
erver.TCPServer):
class ThreadedTCPServer(
SocketServer.ThreadingMixIn, SocketS
erver.TCPServer):
pass
pass
def client(ip, port, message):
def client(ip, port, message):
...
...
Doc/whatsnew/2.6.rst
Dosyayı görüntüle @
e152a77d
...
@@ -1485,6 +1485,8 @@ details.
...
@@ -1485,6 +1485,8 @@ details.
* :mod:`Tkinter` has become the :mod:`tkinter` package.
* :mod:`Tkinter` has become the :mod:`tkinter` package.
* :mod:`Queue` has become :mod:`queue`.
* :mod:`Queue` has become :mod:`queue`.
.. XXX no warnings anymore for renamed modules!
The list of deprecated modules is:
The list of deprecated modules is:
:mod:`audiodev`,
:mod:`audiodev`,
:mod:`bgenlocations`,
:mod:`bgenlocations`,
...
@@ -2067,7 +2069,7 @@ details.
...
@@ -2067,7 +2069,7 @@ details.
and connects to it using an optional timeout value, returning
and connects to it using an optional timeout value, returning
the connected socket object.
the connected socket object.
* The base classes in the :mod:`
sockets
erver` module now support
* The base classes in the :mod:`
SocketS
erver` module now support
calling a :meth:`handle_timeout` method after a span of inactivity
calling a :meth:`handle_timeout` method after a span of inactivity
specified by the server's :attr:`timeout` attribute. (Contributed
specified by the server's :attr:`timeout` attribute. (Contributed
by Michael Pomraning.) The :meth:`serve_forever` method
by Michael Pomraning.) The :meth:`serve_forever` method
...
...
Lib/BaseHTTPServer.py
Dosyayı görüntüle @
e152a77d
...
@@ -74,7 +74,7 @@ import sys
...
@@ -74,7 +74,7 @@ import sys
import
time
import
time
import
socket
# For gethostbyaddr()
import
socket
# For gethostbyaddr()
import
mimetools
import
mimetools
import
sockets
erver
import
SocketS
erver
# Default error message template
# Default error message template
DEFAULT_ERROR_MESSAGE
=
"""
\
DEFAULT_ERROR_MESSAGE
=
"""
\
...
@@ -94,19 +94,19 @@ DEFAULT_ERROR_CONTENT_TYPE = "text/html"
...
@@ -94,19 +94,19 @@ DEFAULT_ERROR_CONTENT_TYPE = "text/html"
def
_quote_html
(
html
):
def
_quote_html
(
html
):
return
html
.
replace
(
"&"
,
"&"
)
.
replace
(
"<"
,
"<"
)
.
replace
(
">"
,
">"
)
return
html
.
replace
(
"&"
,
"&"
)
.
replace
(
"<"
,
"<"
)
.
replace
(
">"
,
">"
)
class
HTTPServer
(
sockets
erver
.
TCPServer
):
class
HTTPServer
(
SocketS
erver
.
TCPServer
):
allow_reuse_address
=
1
# Seems to make sense in testing environment
allow_reuse_address
=
1
# Seems to make sense in testing environment
def
server_bind
(
self
):
def
server_bind
(
self
):
"""Override server_bind to store the server name."""
"""Override server_bind to store the server name."""
sockets
erver
.
TCPServer
.
server_bind
(
self
)
SocketS
erver
.
TCPServer
.
server_bind
(
self
)
host
,
port
=
self
.
socket
.
getsockname
()[:
2
]
host
,
port
=
self
.
socket
.
getsockname
()[:
2
]
self
.
server_name
=
socket
.
getfqdn
(
host
)
self
.
server_name
=
socket
.
getfqdn
(
host
)
self
.
server_port
=
port
self
.
server_port
=
port
class
BaseHTTPRequestHandler
(
sockets
erver
.
StreamRequestHandler
):
class
BaseHTTPRequestHandler
(
SocketS
erver
.
StreamRequestHandler
):
"""HTTP request handler base class.
"""HTTP request handler base class.
...
...
Lib/SimpleXMLRPCServer.py
Dosyayı görüntüle @
e152a77d
...
@@ -101,7 +101,7 @@ server.handle_request()
...
@@ -101,7 +101,7 @@ server.handle_request()
import
xmlrpclib
import
xmlrpclib
from
xmlrpclib
import
Fault
from
xmlrpclib
import
Fault
import
sockets
erver
import
SocketS
erver
import
BaseHTTPServer
import
BaseHTTPServer
import
sys
import
sys
import
os
import
os
...
@@ -512,7 +512,7 @@ class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
...
@@ -512,7 +512,7 @@ class SimpleXMLRPCRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
if
self
.
server
.
logRequests
:
if
self
.
server
.
logRequests
:
BaseHTTPServer
.
BaseHTTPRequestHandler
.
log_request
(
self
,
code
,
size
)
BaseHTTPServer
.
BaseHTTPRequestHandler
.
log_request
(
self
,
code
,
size
)
class
SimpleXMLRPCServer
(
sockets
erver
.
TCPServer
,
class
SimpleXMLRPCServer
(
SocketS
erver
.
TCPServer
,
SimpleXMLRPCDispatcher
):
SimpleXMLRPCDispatcher
):
"""Simple XML-RPC server.
"""Simple XML-RPC server.
...
@@ -536,7 +536,7 @@ class SimpleXMLRPCServer(socketserver.TCPServer,
...
@@ -536,7 +536,7 @@ class SimpleXMLRPCServer(socketserver.TCPServer,
self
.
logRequests
=
logRequests
self
.
logRequests
=
logRequests
SimpleXMLRPCDispatcher
.
__init__
(
self
,
allow_none
,
encoding
)
SimpleXMLRPCDispatcher
.
__init__
(
self
,
allow_none
,
encoding
)
sockets
erver
.
TCPServer
.
__init__
(
self
,
addr
,
requestHandler
,
bind_and_activate
)
SocketS
erver
.
TCPServer
.
__init__
(
self
,
addr
,
requestHandler
,
bind_and_activate
)
# [Bug #1222790] If possible, set close-on-exec flag; if a
# [Bug #1222790] If possible, set close-on-exec flag; if a
# method spawns a subprocess, the subprocess shouldn't have
# method spawns a subprocess, the subprocess shouldn't have
...
...
Lib/
lib-old/
SocketServer.py
→
Lib/SocketServer.py
Dosyayı görüntüle @
e152a77d
File moved
Lib/idlelib/rpc.py
Dosyayı görüntüle @
e152a77d
...
@@ -5,7 +5,7 @@ connect to the Idle process, which listens for the connection. Since Idle has
...
@@ -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.
has only one client per server, this was not a limitation.
+---------------------------------+ +-------------+
+---------------------------------+ +-------------+
|
sockets
erver.BaseRequestHandler | | SocketIO |
|
SocketS
erver.BaseRequestHandler | | SocketIO |
+---------------------------------+ +-------------+
+---------------------------------+ +-------------+
^ | register() |
^ | register() |
| | unregister()|
| | unregister()|
...
@@ -31,7 +31,7 @@ import sys
...
@@ -31,7 +31,7 @@ import sys
import
os
import
os
import
socket
import
socket
import
select
import
select
import
sockets
erver
import
SocketS
erver
import
struct
import
struct
import
cPickle
as
pickle
import
cPickle
as
pickle
import
threading
import
threading
...
@@ -66,12 +66,12 @@ copy_reg.pickle(types.CodeType, pickle_code, unpickle_code)
...
@@ -66,12 +66,12 @@ copy_reg.pickle(types.CodeType, pickle_code, unpickle_code)
BUFSIZE
=
8
*
1024
BUFSIZE
=
8
*
1024
LOCALHOST
=
'127.0.0.1'
LOCALHOST
=
'127.0.0.1'
class
RPCServer
(
sockets
erver
.
TCPServer
):
class
RPCServer
(
SocketS
erver
.
TCPServer
):
def
__init__
(
self
,
addr
,
handlerclass
=
None
):
def
__init__
(
self
,
addr
,
handlerclass
=
None
):
if
handlerclass
is
None
:
if
handlerclass
is
None
:
handlerclass
=
RPCHandler
handlerclass
=
RPCHandler
sockets
erver
.
TCPServer
.
__init__
(
self
,
addr
,
handlerclass
)
SocketS
erver
.
TCPServer
.
__init__
(
self
,
addr
,
handlerclass
)
def
server_bind
(
self
):
def
server_bind
(
self
):
"Override TCPServer method, no bind() phase for connecting entity"
"Override TCPServer method, no bind() phase for connecting entity"
...
@@ -492,7 +492,7 @@ class RemoteProxy(object):
...
@@ -492,7 +492,7 @@ class RemoteProxy(object):
def
__init__
(
self
,
oid
):
def
__init__
(
self
,
oid
):
self
.
oid
=
oid
self
.
oid
=
oid
class
RPCHandler
(
sockets
erver
.
BaseRequestHandler
,
SocketIO
):
class
RPCHandler
(
SocketS
erver
.
BaseRequestHandler
,
SocketIO
):
debugging
=
False
debugging
=
False
location
=
"#S"
# Server
location
=
"#S"
# Server
...
@@ -500,10 +500,10 @@ class RPCHandler(socketserver.BaseRequestHandler, SocketIO):
...
@@ -500,10 +500,10 @@ class RPCHandler(socketserver.BaseRequestHandler, SocketIO):
def
__init__
(
self
,
sock
,
addr
,
svr
):
def
__init__
(
self
,
sock
,
addr
,
svr
):
svr
.
current_handler
=
self
## cgt xxx
svr
.
current_handler
=
self
## cgt xxx
SocketIO
.
__init__
(
self
,
sock
)
SocketIO
.
__init__
(
self
,
sock
)
sockets
erver
.
BaseRequestHandler
.
__init__
(
self
,
sock
,
addr
,
svr
)
SocketS
erver
.
BaseRequestHandler
.
__init__
(
self
,
sock
,
addr
,
svr
)
def
handle
(
self
):
def
handle
(
self
):
"handle() method required by
sockets
erver"
"handle() method required by
SocketS
erver"
self
.
mainloop
()
self
.
mainloop
()
def
get_remote_proxy
(
self
,
oid
):
def
get_remote_proxy
(
self
,
oid
):
...
...
Lib/logging/config.py
Dosyayı görüntüle @
e152a77d
...
@@ -35,7 +35,7 @@ try:
...
@@ -35,7 +35,7 @@ try:
except
ImportError
:
except
ImportError
:
thread
=
None
thread
=
None
from
sockets
erver
import
ThreadingTCPServer
,
StreamRequestHandler
from
SocketS
erver
import
ThreadingTCPServer
,
StreamRequestHandler
DEFAULT_LOGGING_CONFIG_PORT
=
9030
DEFAULT_LOGGING_CONFIG_PORT
=
9030
...
...
Lib/test/test___all__.py
Dosyayı görüntüle @
e152a77d
...
@@ -42,7 +42,7 @@ class AllTest(unittest.TestCase):
...
@@ -42,7 +42,7 @@ class AllTest(unittest.TestCase):
self
.
check_all
(
"MimeWriter"
)
self
.
check_all
(
"MimeWriter"
)
self
.
check_all
(
"queue"
)
self
.
check_all
(
"queue"
)
self
.
check_all
(
"SimpleHTTPServer"
)
self
.
check_all
(
"SimpleHTTPServer"
)
self
.
check_all
(
"
sockets
erver"
)
self
.
check_all
(
"
SocketS
erver"
)
self
.
check_all
(
"StringIO"
)
self
.
check_all
(
"StringIO"
)
self
.
check_all
(
"UserString"
)
self
.
check_all
(
"UserString"
)
self
.
check_all
(
"aifc"
)
self
.
check_all
(
"aifc"
)
...
...
Lib/test/test_logging.py
Dosyayı görüntüle @
e152a77d
...
@@ -33,7 +33,7 @@ import os
...
@@ -33,7 +33,7 @@ import os
import
re
import
re
import
select
import
select
import
socket
import
socket
from
sockets
erver
import
ThreadingTCPServer
,
StreamRequestHandler
from
SocketS
erver
import
ThreadingTCPServer
,
StreamRequestHandler
import
string
import
string
import
struct
import
struct
import
sys
import
sys
...
...
Lib/test/test_py3kwarn.py
Dosyayı görüntüle @
e152a77d
...
@@ -216,7 +216,6 @@ class TestStdlibRemovals(unittest.TestCase):
...
@@ -216,7 +216,6 @@ class TestStdlibRemovals(unittest.TestCase):
class
TestStdlibRenames
(
unittest
.
TestCase
):
class
TestStdlibRenames
(
unittest
.
TestCase
):
renames
=
{
'Queue'
:
'queue'
,
renames
=
{
'Queue'
:
'queue'
,
'SocketServer'
:
'socketserver'
,
'ConfigParser'
:
'configparser'
,
'ConfigParser'
:
'configparser'
,
}
}
...
...
Lib/test/test_socketserver.py
Dosyayı görüntüle @
e152a77d
"""
"""
Test suite for
socketserver
.
Test suite for
SocketServer.py
.
"""
"""
import
contextlib
import
contextlib
...
@@ -13,7 +13,7 @@ import tempfile
...
@@ -13,7 +13,7 @@ import tempfile
import
threading
import
threading
import
time
import
time
import
unittest
import
unittest
import
sockets
erver
import
SocketS
erver
import
test.test_support
import
test.test_support
from
test.test_support
import
reap_children
,
verbose
,
TestSkipped
from
test.test_support
import
reap_children
,
verbose
,
TestSkipped
...
@@ -40,12 +40,12 @@ def receive(sock, n, timeout=20):
...
@@ -40,12 +40,12 @@ def receive(sock, n, timeout=20):
raise
RuntimeError
,
"timed out on
%
r"
%
(
sock
,)
raise
RuntimeError
,
"timed out on
%
r"
%
(
sock
,)
if
HAVE_UNIX_SOCKETS
:
if
HAVE_UNIX_SOCKETS
:
class
ForkingUnixStreamServer
(
sockets
erver
.
ForkingMixIn
,
class
ForkingUnixStreamServer
(
SocketS
erver
.
ForkingMixIn
,
sockets
erver
.
UnixStreamServer
):
SocketS
erver
.
UnixStreamServer
):
pass
pass
class
ForkingUnixDatagramServer
(
sockets
erver
.
ForkingMixIn
,
class
ForkingUnixDatagramServer
(
SocketS
erver
.
ForkingMixIn
,
sockets
erver
.
UnixDatagramServer
):
SocketS
erver
.
UnixDatagramServer
):
pass
pass
...
@@ -172,55 +172,55 @@ class SocketServerTest(unittest.TestCase):
...
@@ -172,55 +172,55 @@ class SocketServerTest(unittest.TestCase):
s
.
close
()
s
.
close
()
def
test_TCPServer
(
self
):
def
test_TCPServer
(
self
):
self
.
run_server
(
sockets
erver
.
TCPServer
,
self
.
run_server
(
SocketS
erver
.
TCPServer
,
sockets
erver
.
StreamRequestHandler
,
SocketS
erver
.
StreamRequestHandler
,
self
.
stream_examine
)
self
.
stream_examine
)
def
test_ThreadingTCPServer
(
self
):
def
test_ThreadingTCPServer
(
self
):
self
.
run_server
(
sockets
erver
.
ThreadingTCPServer
,
self
.
run_server
(
SocketS
erver
.
ThreadingTCPServer
,
sockets
erver
.
StreamRequestHandler
,
SocketS
erver
.
StreamRequestHandler
,
self
.
stream_examine
)
self
.
stream_examine
)
if
HAVE_FORKING
:
if
HAVE_FORKING
:
def
test_ForkingTCPServer
(
self
):
def
test_ForkingTCPServer
(
self
):
with
simple_subprocess
(
self
):
with
simple_subprocess
(
self
):
self
.
run_server
(
sockets
erver
.
ForkingTCPServer
,
self
.
run_server
(
SocketS
erver
.
ForkingTCPServer
,
sockets
erver
.
StreamRequestHandler
,
SocketS
erver
.
StreamRequestHandler
,
self
.
stream_examine
)
self
.
stream_examine
)
if
HAVE_UNIX_SOCKETS
:
if
HAVE_UNIX_SOCKETS
:
def
test_UnixStreamServer
(
self
):
def
test_UnixStreamServer
(
self
):
self
.
run_server
(
sockets
erver
.
UnixStreamServer
,
self
.
run_server
(
SocketS
erver
.
UnixStreamServer
,
sockets
erver
.
StreamRequestHandler
,
SocketS
erver
.
StreamRequestHandler
,
self
.
stream_examine
)
self
.
stream_examine
)
def
test_ThreadingUnixStreamServer
(
self
):
def
test_ThreadingUnixStreamServer
(
self
):
self
.
run_server
(
sockets
erver
.
ThreadingUnixStreamServer
,
self
.
run_server
(
SocketS
erver
.
ThreadingUnixStreamServer
,
sockets
erver
.
StreamRequestHandler
,
SocketS
erver
.
StreamRequestHandler
,
self
.
stream_examine
)
self
.
stream_examine
)
if
HAVE_FORKING
:
if
HAVE_FORKING
:
def
test_ForkingUnixStreamServer
(
self
):
def
test_ForkingUnixStreamServer
(
self
):
with
simple_subprocess
(
self
):
with
simple_subprocess
(
self
):
self
.
run_server
(
ForkingUnixStreamServer
,
self
.
run_server
(
ForkingUnixStreamServer
,
sockets
erver
.
StreamRequestHandler
,
SocketS
erver
.
StreamRequestHandler
,
self
.
stream_examine
)
self
.
stream_examine
)
def
test_UDPServer
(
self
):
def
test_UDPServer
(
self
):
self
.
run_server
(
sockets
erver
.
UDPServer
,
self
.
run_server
(
SocketS
erver
.
UDPServer
,
sockets
erver
.
DatagramRequestHandler
,
SocketS
erver
.
DatagramRequestHandler
,
self
.
dgram_examine
)
self
.
dgram_examine
)
def
test_ThreadingUDPServer
(
self
):
def
test_ThreadingUDPServer
(
self
):
self
.
run_server
(
sockets
erver
.
ThreadingUDPServer
,
self
.
run_server
(
SocketS
erver
.
ThreadingUDPServer
,
sockets
erver
.
DatagramRequestHandler
,
SocketS
erver
.
DatagramRequestHandler
,
self
.
dgram_examine
)
self
.
dgram_examine
)
if
HAVE_FORKING
:
if
HAVE_FORKING
:
def
test_ForkingUDPServer
(
self
):
def
test_ForkingUDPServer
(
self
):
with
simple_subprocess
(
self
):
with
simple_subprocess
(
self
):
self
.
run_server
(
sockets
erver
.
ForkingUDPServer
,
self
.
run_server
(
SocketS
erver
.
ForkingUDPServer
,
sockets
erver
.
DatagramRequestHandler
,
SocketS
erver
.
DatagramRequestHandler
,
self
.
dgram_examine
)
self
.
dgram_examine
)
# Alas, on Linux (at least) recvfrom() doesn't return a meaningful
# Alas, on Linux (at least) recvfrom() doesn't return a meaningful
...
@@ -228,19 +228,19 @@ class SocketServerTest(unittest.TestCase):
...
@@ -228,19 +228,19 @@ class SocketServerTest(unittest.TestCase):
# if HAVE_UNIX_SOCKETS:
# if HAVE_UNIX_SOCKETS:
# def test_UnixDatagramServer(self):
# def test_UnixDatagramServer(self):
# self.run_server(
sockets
erver.UnixDatagramServer,
# self.run_server(
SocketS
erver.UnixDatagramServer,
#
sockets
erver.DatagramRequestHandler,
#
SocketS
erver.DatagramRequestHandler,
# self.dgram_examine)
# self.dgram_examine)
#
#
# def test_ThreadingUnixDatagramServer(self):
# def test_ThreadingUnixDatagramServer(self):
# self.run_server(
sockets
erver.ThreadingUnixDatagramServer,
# self.run_server(
SocketS
erver.ThreadingUnixDatagramServer,
#
sockets
erver.DatagramRequestHandler,
#
SocketS
erver.DatagramRequestHandler,
# self.dgram_examine)
# self.dgram_examine)
#
#
# if HAVE_FORKING:
# if HAVE_FORKING:
# def test_ForkingUnixDatagramServer(self):
# def test_ForkingUnixDatagramServer(self):
# self.run_server(
sockets
erver.ForkingUnixDatagramServer,
# self.run_server(
SocketS
erver.ForkingUnixDatagramServer,
#
sockets
erver.DatagramRequestHandler,
#
SocketS
erver.DatagramRequestHandler,
# self.dgram_examine)
# self.dgram_examine)
...
...
Lib/test/test_wsgiref.py
Dosyayı görüntüle @
e152a77d
...
@@ -8,7 +8,7 @@ from wsgiref.validate import validator
...
@@ -8,7 +8,7 @@ from wsgiref.validate import validator
from
wsgiref.simple_server
import
WSGIServer
,
WSGIRequestHandler
,
demo_app
from
wsgiref.simple_server
import
WSGIServer
,
WSGIRequestHandler
,
demo_app
from
wsgiref.simple_server
import
make_server
from
wsgiref.simple_server
import
make_server
from
StringIO
import
StringIO
from
StringIO
import
StringIO
from
sockets
erver
import
BaseServer
from
SocketS
erver
import
BaseServer
import
re
,
sys
import
re
,
sys
from
test
import
test_support
from
test
import
test_support
...
...
Misc/NEWS
Dosyayı görüntüle @
e152a77d
...
@@ -161,9 +161,6 @@ Library
...
@@ -161,9 +161,6 @@ Library
- The multifile module has been deprecated as per PEP 4.
- The multifile module has been deprecated as per PEP 4.
- The SocketServer module has been renamed 'socketserver'. The old
name is now deprecated.
- The imageop module has been deprecated for removal in Python 3.0.
- The imageop module has been deprecated for removal in Python 3.0.
- Issue #2250: Exceptions raised during evaluation of names in
- Issue #2250: Exceptions raised during evaluation of names in
...
...
Misc/cheatsheet
Dosyayı görüntüle @
e152a77d
...
@@ -1973,7 +1973,7 @@ site Append module search paths for third-party packages to
...
@@ -1973,7 +1973,7 @@ site Append module search paths for third-party packages to
sys.path.
sys.path.
smtplib SMTP Client class (RFC 821)
smtplib SMTP Client class (RFC 821)
sndhdr Several routines that help recognizing sound.
sndhdr Several routines that help recognizing sound.
sockets
erver Generic socket server classes.
SocketS
erver Generic socket server classes.
stat Constants and functions for interpreting stat/lstat struct.
stat Constants and functions for interpreting stat/lstat struct.
statcache Maintain a cache of file stats.
statcache Maintain a cache of file stats.
statvfs Constants for interpreting statvfs struct as returned by
statvfs Constants for interpreting statvfs struct as returned by
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment