diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-07-18 05:56:09 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-07-18 05:56:09 (GMT) |
commit | e6ddc8b20b493fef2e7cffb2e1351fe1d238857e (patch) | |
tree | 3b3d8fcd92e1d8f0cad44297d5c2ae8522bb984c /Demo/sockets/finger.py | |
parent | 4fba4521e836e0cab08316592392b1e4d06eb6ef (diff) | |
download | cpython-e6ddc8b20b493fef2e7cffb2e1351fe1d238857e.zip cpython-e6ddc8b20b493fef2e7cffb2e1351fe1d238857e.tar.gz cpython-e6ddc8b20b493fef2e7cffb2e1351fe1d238857e.tar.bz2 |
Whitespace normalization. Ran reindent.py over the entire source tree.
Diffstat (limited to 'Demo/sockets/finger.py')
-rwxr-xr-x | Demo/sockets/finger.py | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Demo/sockets/finger.py b/Demo/sockets/finger.py index 0c2baed..e8b9ed2 100755 --- a/Demo/sockets/finger.py +++ b/Demo/sockets/finger.py @@ -22,35 +22,35 @@ FINGER_PORT = 79 # Output goes directly to stdout (although this can be changed). # def finger(host, args): - s = socket(AF_INET, SOCK_STREAM) - s.connect((host, FINGER_PORT)) - s.send(args + '\n') - while 1: - buf = s.recv(1024) - if not buf: break - sys.stdout.write(buf) - sys.stdout.flush() + s = socket(AF_INET, SOCK_STREAM) + s.connect((host, FINGER_PORT)) + s.send(args + '\n') + while 1: + buf = s.recv(1024) + if not buf: break + sys.stdout.write(buf) + sys.stdout.flush() # Main function: argument parsing. # def main(): - options = '' - i = 1 - while i < len(sys.argv) and sys.argv[i][:1] == '-': - options = options + sys.argv[i] + ' ' - i = i+1 - args = sys.argv[i:] - if not args: - args = [''] - for arg in args: - if '@' in arg: - at = string.index(arg, '@') - host = arg[at+1:] - arg = arg[:at] - else: - host = '' - finger(host, options + arg) + options = '' + i = 1 + while i < len(sys.argv) and sys.argv[i][:1] == '-': + options = options + sys.argv[i] + ' ' + i = i+1 + args = sys.argv[i:] + if not args: + args = [''] + for arg in args: + if '@' in arg: + at = string.index(arg, '@') + host = arg[at+1:] + arg = arg[:at] + else: + host = '' + finger(host, options + arg) # Call the main function. |