summaryrefslogtreecommitdiff
path: root/Demo/pdist/client.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-06-21 02:08:55 +0000
committerGuido van Rossum <guido@python.org>1995-06-21 02:08:55 +0000
commite02fc2ecc2543ae1c68ba0b759218ec918f92325 (patch)
tree69986e1956ea08d2e3cc196c8bfed01707b5f4b9 /Demo/pdist/client.py
parent64bb2b9786d1022f080f3a574852c0604d974cea (diff)
downloadcpython-e02fc2ecc2543ae1c68ba0b759218ec918f92325.tar.gz
bugfixes
Diffstat (limited to 'Demo/pdist/client.py')
-rwxr-xr-xDemo/pdist/client.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Demo/pdist/client.py b/Demo/pdist/client.py
index b644180406..d8f210e71b 100755
--- a/Demo/pdist/client.py
+++ b/Demo/pdist/client.py
@@ -16,6 +16,10 @@ class Client:
"""RPC Client class. No need to derive a class -- it's fully generic."""
def __init__(self, address, verbose = VERBOSE):
+ self._pre_init(address, verbose)
+ self._post_init()
+
+ def _pre_init(self, address, verbose = VERBOSE):
if type(address) == type(0):
address = ('', address)
self._address = address
@@ -29,6 +33,8 @@ class Client:
self._replies = {} # Unprocessed replies
self._rf = self._socket.makefile('r')
self._wf = self._socket.makefile('w')
+
+ def _post_init(self):
self._methods = self._call('.methods')
def __del__(self):
@@ -127,15 +133,16 @@ class SecureClient(Client, Security):
def __init__(self, *args):
import string
- apply(Client.__init__, (self,) + args)
+ apply(self._pre_init, args)
Security.__init__(self)
line = self._rf.readline()
- challenge = string.atoi(string.strip(firstline))
+ challenge = string.atoi(string.strip(line))
response = self._encode_challenge(challenge)
line = `long(response)`
if line[-1] in 'Ll': line = line[:-1]
self._wf.write(line + '\n')
self._wf.flush()
+ self._post_init()
class _stub: