diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2003-09-10 02:42:18 +0000 |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2003-09-10 02:42:18 +0000 |
commit | f7e2563c038972d44d0d5bf187b5623ceb2eae81 (patch) | |
tree | 3361669d6a15c66a783ff2ae9b892c0e74d0edfa /Lib/idlelib | |
parent | 19c8ef55308b51337a0419a69d2d3b4e7adf6454 (diff) | |
download | cpython-f7e2563c038972d44d0d5bf187b5623ceb2eae81.tar.gz |
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.
Diffstat (limited to 'Lib/idlelib')
-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 00a1fe3a00..0000000000 --- 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 00a1fe3a00..537dd5a9a7 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 63e0ffa814..90451e39bb 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. |