Kaydet (Commit) dcba6622 authored tarafından Kurt B. Kaiser's avatar Kurt B. Kaiser

The remote procedure call module rpc.py can now access data attributes of

remote registered objects.  Changes to these attributes are local, however.

M EditorWindow.py
M NEWS.txt
M PyShell.py
M idlever.py
M rpc.py
M run.py
üst f654c1c3
...@@ -37,7 +37,7 @@ def _find_module(fullname, path=None): ...@@ -37,7 +37,7 @@ def _find_module(fullname, path=None):
raise ImportError, 'No source for module ' + module.__name__ raise ImportError, 'No source for module ' + module.__name__
return file, filename, descr return file, filename, descr
class EditorWindow: class EditorWindow(object):
from Percolator import Percolator from Percolator import Percolator
from ColorDelegator import ColorDelegator from ColorDelegator import ColorDelegator
from UndoDelegator import UndoDelegator from UndoDelegator import UndoDelegator
...@@ -1297,7 +1297,7 @@ import tokenize ...@@ -1297,7 +1297,7 @@ import tokenize
_tokenize = tokenize _tokenize = tokenize
del tokenize del tokenize
class IndentSearcher: class IndentSearcher(object):
# .run() chews over the Text widget, looking for a block opener # .run() chews over the Text widget, looking for a block opener
# and the stmt following it. Returns a pair, # and the stmt following it. Returns a pair,
......
What's New in IDLE 1.2a0?
=======================
*Release date: XX-XXX-2005*
- The remote procedure call module rpc.py can now access data attributes of
remote registered objects. Changes to these attributes are local, however.
What's New in IDLE 1.1? What's New in IDLE 1.1?
======================= =======================
......
...@@ -1186,7 +1186,7 @@ class PyShell(OutputWindow): ...@@ -1186,7 +1186,7 @@ class PyShell(OutputWindow):
if not use_subprocess: if not use_subprocess:
raise KeyboardInterrupt raise KeyboardInterrupt
class PseudoFile: class PseudoFile(object):
def __init__(self, shell, tags, encoding=None): def __init__(self, shell, tags, encoding=None):
self.shell = shell self.shell = shell
......
IDLE_VERSION = "1.1" IDLE_VERSION = "1.2a0"
...@@ -121,7 +121,7 @@ request_queue = Queue.Queue(0) ...@@ -121,7 +121,7 @@ request_queue = Queue.Queue(0)
response_queue = Queue.Queue(0) response_queue = Queue.Queue(0)
class SocketIO: class SocketIO(object):
nextseq = 0 nextseq = 0
...@@ -475,7 +475,7 @@ class SocketIO: ...@@ -475,7 +475,7 @@ class SocketIO:
#----------------- end class SocketIO -------------------- #----------------- end class SocketIO --------------------
class RemoteObject: class RemoteObject(object):
# Token mix-in class # Token mix-in class
pass pass
...@@ -484,7 +484,7 @@ def remoteref(obj): ...@@ -484,7 +484,7 @@ def remoteref(obj):
objecttable[oid] = obj objecttable[oid] = obj
return RemoteProxy(oid) return RemoteProxy(oid)
class RemoteProxy: class RemoteProxy(object):
def __init__(self, oid): def __init__(self, oid):
self.oid = oid self.oid = oid
...@@ -533,7 +533,7 @@ class RPCClient(SocketIO): ...@@ -533,7 +533,7 @@ class RPCClient(SocketIO):
def get_remote_proxy(self, oid): def get_remote_proxy(self, oid):
return RPCProxy(self, oid) return RPCProxy(self, oid)
class RPCProxy: class RPCProxy(object):
__methods = None __methods = None
__attributes = None __attributes = None
...@@ -549,7 +549,11 @@ class RPCProxy: ...@@ -549,7 +549,11 @@ class RPCProxy:
return MethodProxy(self.sockio, self.oid, name) return MethodProxy(self.sockio, self.oid, name)
if self.__attributes is None: if self.__attributes is None:
self.__getattributes() self.__getattributes()
if not self.__attributes.has_key(name): if self.__attributes.has_key(name):
value = self.sockio.remotecall(self.oid, '__getattribute__',
(name,), {})
return value
else:
raise AttributeError, name raise AttributeError, name
def __getattributes(self): def __getattributes(self):
...@@ -579,7 +583,7 @@ def _getattributes(obj, attributes): ...@@ -579,7 +583,7 @@ def _getattributes(obj, attributes):
if not callable(attr): if not callable(attr):
attributes[name] = 1 attributes[name] = 1
class MethodProxy: class MethodProxy(object):
def __init__(self, sockio, oid, name): def __init__(self, sockio, oid, name):
self.sockio = sockio self.sockio = sockio
......
...@@ -270,7 +270,7 @@ class MyHandler(rpc.RPCHandler): ...@@ -270,7 +270,7 @@ class MyHandler(rpc.RPCHandler):
thread.interrupt_main() thread.interrupt_main()
class Executive: class Executive(object):
def __init__(self, rpchandler): def __init__(self, rpchandler):
self.rpchandler = rpchandler self.rpchandler = rpchandler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment