[svn] commit: r3347 - in /branches/trac352/src: bin/cmdctl/ bin/xfrout/ lib/python/isc/utils/ lib/python/isc/utils/tests/

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Oct 25 11:02:00 UTC 2010


Author: zhanglikun
Date: Mon Oct 25 11:01:59 2010
New Revision: 3347

Log:
Rename file from serve_mixin.py to socketserver.py, and rename the class name from ServeMixin NoPollMixIn.

Added:
    branches/trac352/src/lib/python/isc/utils/socketserver_mixin.py
      - copied, changed from r3346, branches/trac352/src/lib/python/isc/utils/serve_mixin.py
Removed:
    branches/trac352/src/lib/python/isc/utils/serve_mixin.py
Modified:
    branches/trac352/src/bin/cmdctl/cmdctl.py.in
    branches/trac352/src/bin/xfrout/xfrout.py.in
    branches/trac352/src/lib/python/isc/utils/Makefile.am
    branches/trac352/src/lib/python/isc/utils/__init__.py
    branches/trac352/src/lib/python/isc/utils/tests/serve_mixin_test.py

Modified: branches/trac352/src/bin/cmdctl/cmdctl.py.in
==============================================================================
--- branches/trac352/src/bin/cmdctl/cmdctl.py.in (original)
+++ branches/trac352/src/bin/cmdctl/cmdctl.py.in Mon Oct 25 11:01:59 2010
@@ -45,7 +45,7 @@
 import isc.utils.process
 from optparse import OptionParser, OptionValueError
 from hashlib import sha1
-from isc.utils import serve_mixin
+from isc.utils import socketserver_mixin
 
 try:
     import threading
@@ -441,7 +441,7 @@
 
         return (keyfile, certfile, accountsfile)
 
-class SecureHTTPServer(serve_mixin.ServeMixIn,
+class SecureHTTPServer(socketserver_mixin.NoPollMixIn,
                        socketserver.ThreadingMixIn,
                        http.server.HTTPServer):
     '''Make the server address can be reused.'''
@@ -451,7 +451,7 @@
                  CommandControlClass,
                  idle_timeout = 1200, verbose = False):
         '''idle_timeout: the max idle time for login'''
-        serve_mixin.ServeMixIn.__init__(self)
+        socketserver_mixin.NoPollMixIn.__init__(self)
         try:
             http.server.HTTPServer.__init__(self, server_address, RequestHandlerClass)
         except socket.error as err:

Modified: branches/trac352/src/bin/xfrout/xfrout.py.in
==============================================================================
--- branches/trac352/src/bin/xfrout/xfrout.py.in (original)
+++ branches/trac352/src/bin/xfrout/xfrout.py.in Mon Oct 25 11:01:59 2010
@@ -34,7 +34,7 @@
 import select
 import errno
 from optparse import OptionParser, OptionValueError
-from isc.utils import serve_mixin
+from isc.utils import socketserver_mixin
 
 try:
     from libxfr_python import *
@@ -291,13 +291,13 @@
 
         self._send_message_with_last_soa(msg, sock, rrset_soa, message_upper_len)
 
-class UnixSockServer(serve_mixin.ServeMixIn, ThreadingUnixStreamServer):
+class UnixSockServer(socketserver_mixin.NoPollMixIn, ThreadingUnixStreamServer):
     '''The unix domain socket server which accept xfr query sent from auth server.'''
 
     def __init__(self, sock_file, handle_class, shutdown_event, config_data, cc, log):
         self._remove_unused_sock_file(sock_file)
         self._sock_file = sock_file
-        serve_mixin.ServeMixIn.__init__(self)
+        socketserver_mixin.NoPollMixIn.__init__(self)
         ThreadingUnixStreamServer.__init__(self, sock_file, handle_class)
         self._lock = threading.Lock()
         self._transfers_counter = 0
@@ -342,7 +342,7 @@
             return True 
 
     def shutdown(self):
-        super().shutdown() # call the shutdown() of class serve_mixin.ServeMinIn
+        super().shutdown() # call the shutdown() of class socketserver_mixin.NoPollMixIn
         try:
             os.unlink(self._sock_file)
         except Exception as e:

Modified: branches/trac352/src/lib/python/isc/utils/Makefile.am
==============================================================================
--- branches/trac352/src/lib/python/isc/utils/Makefile.am (original)
+++ branches/trac352/src/lib/python/isc/utils/Makefile.am Mon Oct 25 11:01:59 2010
@@ -1,5 +1,5 @@
 SUBDIRS = tests
 
-python_PYTHON = __init__.py process.py serve_mixin.py
+python_PYTHON = __init__.py process.py socketserver_mixin.py
 
 pythondir = $(pyexecdir)/isc/utils

Modified: branches/trac352/src/lib/python/isc/utils/__init__.py
==============================================================================
--- branches/trac352/src/lib/python/isc/utils/__init__.py (original)
+++ branches/trac352/src/lib/python/isc/utils/__init__.py Mon Oct 25 11:01:59 2010
@@ -1,1 +1,1 @@
-from isc.utils.serve_mixin import *
+from isc.utils.socketserver_mixin import *

Modified: branches/trac352/src/lib/python/isc/utils/tests/serve_mixin_test.py
==============================================================================
--- branches/trac352/src/lib/python/isc/utils/tests/serve_mixin_test.py (original)
+++ branches/trac352/src/lib/python/isc/utils/tests/serve_mixin_test.py Mon Oct 25 11:01:59 2010
@@ -14,7 +14,7 @@
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 import unittest
-from isc.utils.serve_mixin import ServeMixIn
+from isc.utils.socketserver_mixin import NoPollMixIn
 import socketserver
 import threading
 import socket
@@ -25,12 +25,12 @@
         data = self.request.recv(20)
         self.request.send(data)
 
-class MyServer(ServeMixIn, 
+class MyServer(NoPollMixIn, 
                socketserver.ThreadingMixIn,
                socketserver.TCPServer):
 
     def __init__(self, server_addr, handler_class):
-        ServeMixIn.__init__(self)
+        NoPollMixIn.__init__(self)
         socketserver.TCPServer.__init__(self, server_addr, handler_class)
 
 def send_and_get_reply(ip, port, msg):
@@ -41,7 +41,7 @@
     sock.close()
     return response
 
-class TestServeMixIn(unittest.TestCase):
+class TestNoPollMixIn(unittest.TestCase):
     def test_serve_forever(self):
         # use port 0 to select an arbitrary unused port.
         server = MyServer(('127.0.0.1', 0), MyHandler)




More information about the bind10-changes mailing list