summaryrefslogtreecommitdiff
path: root/Lib/idlelib/rpc.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-08-31 00:50:55 -0400
committerTerry Jan Reedy <tjreedy@udel.edu>2016-08-31 00:50:55 -0400
commitbfbaa6b206abdb8b1c3861926f4334b879ec91cc (patch)
treea06ead659eacb714127ad34289a543942d14e4e6 /Lib/idlelib/rpc.py
parent89b1162511dd62e285c1911013f07b45af07f70a (diff)
downloadcpython-git-bfbaa6b206abdb8b1c3861926f4334b879ec91cc.tar.gz
Issue #27891: Consistently group and sort imports within idlelib modules.
Diffstat (limited to 'Lib/idlelib/rpc.py')
-rw-r--r--Lib/idlelib/rpc.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py
index 48105f2aa1..8f57edb836 100644
--- a/Lib/idlelib/rpc.py
+++ b/Lib/idlelib/rpc.py
@@ -26,23 +26,21 @@ See the Idle run.main() docstring for further information on how this was
accomplished in Idle.
"""
-
-import sys
-import os
+import builtins
+import copyreg
import io
-import socket
+import marshal
+import os
+import pickle
+import queue
import select
+import socket
import socketserver
import struct
-import pickle
+import sys
import threading
-import queue
import traceback
-import copyreg
import types
-import marshal
-import builtins
-
def unpickle_code(ms):
co = marshal.loads(ms)
@@ -60,10 +58,12 @@ def dumps(obj, protocol=None):
p.dump(obj)
return f.getvalue()
+
class CodePickler(pickle.Pickler):
dispatch_table = {types.CodeType: pickle_code}
dispatch_table.update(copyreg.dispatch_table)
+
BUFSIZE = 8*1024
LOCALHOST = '127.0.0.1'
@@ -487,16 +487,19 @@ class RemoteObject(object):
# Token mix-in class
pass
+
def remoteref(obj):
oid = id(obj)
objecttable[oid] = obj
return RemoteProxy(oid)
+
class RemoteProxy(object):
def __init__(self, oid):
self.oid = oid
+
class RPCHandler(socketserver.BaseRequestHandler, SocketIO):
debugging = False
@@ -514,6 +517,7 @@ class RPCHandler(socketserver.BaseRequestHandler, SocketIO):
def get_remote_proxy(self, oid):
return RPCProxy(self, oid)
+
class RPCClient(SocketIO):
debugging = False
@@ -539,6 +543,7 @@ class RPCClient(SocketIO):
def get_remote_proxy(self, oid):
return RPCProxy(self, oid)
+
class RPCProxy(object):
__methods = None
@@ -587,6 +592,7 @@ def _getattributes(obj, attributes):
if not callable(attr):
attributes[name] = 1
+
class MethodProxy(object):
def __init__(self, sockio, oid, name):