diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2003-09-10 02:42:18 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2003-09-10 02:42:18 (GMT) |
commit | 62685d36aaa3a26fb5c6a5935e387b008880436f (patch) | |
tree | 9bd2d61f5efec7283ec6042ae1f35ede4c1bea11 | |
parent | 9756f388c0f553699070a5a407e95fd38821daff (diff) | |
download | cpython-62685d36aaa3a26fb5c6a5935e387b008880436f.zip cpython-62685d36aaa3a26fb5c6a5935e387b008880436f.tar.gz cpython-62685d36aaa3a26fb5c6a5935e387b008880436f.tar.bz2 |
Python Bug 775061
1. Remove "idle" script, it lives in Tools/scripts/ now.
2. Remove shebang from idle.py, should be called explicitly.
3. Remove obsolete test code from rpc.py; needs unit test.
-rwxr-xr-x | Lib/idlelib/idle | 23 | ||||
-rw-r--r-- | Lib/idlelib/idle.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/rpc.py | 74 |
3 files changed, 2 insertions, 97 deletions
diff --git a/Lib/idlelib/idle b/Lib/idlelib/idle deleted file mode 100755 index 00a1fe3..0000000 --- a/Lib/idlelib/idle +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python - -try: - import idlelib.PyShell -except ImportError: - # IDLE is not installed, but maybe PyShell is on sys.path: - try: - import PyShell - except ImportError: - raise - else: - import os - idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) - if idledir != os.getcwd(): - # We're not in the IDLE directory, help the subprocess find run.py - pypath = os.environ.get('PYTHONPATH', '') - if pypath: - os.environ['PYTHONPATH'] = pypath + ':' + idledir - else: - os.environ['PYTHONPATH'] = idledir - PyShell.main() -else: - idlelib.PyShell.main() diff --git a/Lib/idlelib/idle.py b/Lib/idlelib/idle.py index 00a1fe3..537dd5a 100644 --- a/Lib/idlelib/idle.py +++ b/Lib/idlelib/idle.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - try: import idlelib.PyShell except ImportError: diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index 63e0ffa..90451e3 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -592,76 +592,6 @@ class MethodProxy: value = self.sockio.remotecall(self.oid, self.name, args, kwargs) return value -# -# Self Test -# - -def testServer(addr): - # XXX 25 Jul 02 KBK needs update to use rpc.py register/unregister methods - class RemotePerson: - def __init__(self,name): - self.name = name - def greet(self, name): - print "(someone called greet)" - print "Hello %s, I am %s." % (name, self.name) - print - def getName(self): - print "(someone called getName)" - print - return self.name - def greet_this_guy(self, name): - print "(someone called greet_this_guy)" - print "About to greet %s ..." % name - remote_guy = self.server.current_handler.get_remote_proxy(name) - remote_guy.greet("Thomas Edison") - print "Done." - print - - person = RemotePerson("Thomas Edison") - svr = RPCServer(addr) - svr.register('thomas', person) - person.server = svr # only required if callbacks are used - - # svr.serve_forever() - svr.handle_request() # process once only - -def testClient(addr): - "demonstrates RPC Client" - # XXX 25 Jul 02 KBK needs update to use rpc.py register/unregister methods - import time - clt=RPCClient(addr) - thomas = clt.get_remote_proxy("thomas") - print "The remote person's name is ..." - print thomas.getName() - # print clt.remotecall("thomas", "getName", (), {}) - print - time.sleep(1) - print "Getting remote thomas to say hi..." - thomas.greet("Alexander Bell") - #clt.remotecall("thomas","greet",("Alexander Bell",), {}) - print "Done." - print - time.sleep(2) - # demonstrates remote server calling local instance - class LocalPerson: - def __init__(self,name): - self.name = name - def greet(self, name): - print "You've greeted me!" - def getName(self): - return self.name - person = LocalPerson("Alexander Bell") - clt.register("alexander",person) - thomas.greet_this_guy("alexander") - # clt.remotecall("thomas","greet_this_guy",("alexander",), {}) - -def test(): - addr=(LOCALHOST, 8833) - if len(sys.argv) == 2: - if sys.argv[1]=='-server': - testServer(addr) - return - testClient(addr) -if __name__ == '__main__': - test() +# XXX KBK 09Sep03 We need a proper unit test for this module. Previously +# existing test code was removed at Rev 1.27. |