mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
New == syntax
This commit is contained in:
parent
61cfd96003
commit
f628a985ff
4 changed files with 10 additions and 10 deletions
|
@ -37,7 +37,7 @@ def finger(host, args):
|
||||||
def main():
|
def main():
|
||||||
options = ''
|
options = ''
|
||||||
i = 1
|
i = 1
|
||||||
while i < len(sys.argv) and sys.argv[i][:1] = '-':
|
while i < len(sys.argv) and sys.argv[i][:1] == '-':
|
||||||
options = options + sys.argv[i] + ' '
|
options = options + sys.argv[i] + ' '
|
||||||
i = i+1
|
i = i+1
|
||||||
args = sys.argv[i:]
|
args = sys.argv[i:]
|
||||||
|
|
|
@ -58,7 +58,7 @@ def main():
|
||||||
#
|
#
|
||||||
pid = posix.fork()
|
pid = posix.fork()
|
||||||
#
|
#
|
||||||
if pid = 0:
|
if pid == 0:
|
||||||
# child -- read stdin, write socket
|
# child -- read stdin, write socket
|
||||||
while 1:
|
while 1:
|
||||||
line = sys.stdin.readline()
|
line = sys.stdin.readline()
|
||||||
|
@ -82,19 +82,19 @@ def main():
|
||||||
opt = ''
|
opt = ''
|
||||||
elif iac:
|
elif iac:
|
||||||
iac = 0
|
iac = 0
|
||||||
if c = IAC:
|
if c == IAC:
|
||||||
cleandata = cleandata + c
|
cleandata = cleandata + c
|
||||||
elif c in (DO, DONT):
|
elif c in (DO, DONT):
|
||||||
if c = DO: print '(DO)',
|
if c == DO: print '(DO)',
|
||||||
else: print '(DONT)',
|
else: print '(DONT)',
|
||||||
opt = IAC + WONT
|
opt = IAC + WONT
|
||||||
elif c in (WILL, WONT):
|
elif c in (WILL, WONT):
|
||||||
if c = WILL: print '(WILL)',
|
if c == WILL: print '(WILL)',
|
||||||
else: print '(WONT)',
|
else: print '(WONT)',
|
||||||
opt = IAC + DONT
|
opt = IAC + DONT
|
||||||
else:
|
else:
|
||||||
print '(command)', ord(c)
|
print '(command)', ord(c)
|
||||||
elif c = IAC:
|
elif c == IAC:
|
||||||
iac = 1
|
iac = 1
|
||||||
print '(IAC)',
|
print '(IAC)',
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -23,9 +23,9 @@ BUFSIZE = 1024
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
usage()
|
usage()
|
||||||
if sys.argv[1] = '-s':
|
if sys.argv[1] == '-s':
|
||||||
server()
|
server()
|
||||||
elif sys.argv[1] = '-c':
|
elif sys.argv[1] == '-c':
|
||||||
client()
|
client()
|
||||||
else:
|
else:
|
||||||
usage()
|
usage()
|
||||||
|
|
|
@ -14,9 +14,9 @@ BUFSIZE = 1024
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
usage()
|
usage()
|
||||||
if sys.argv[1] = '-s':
|
if sys.argv[1] == '-s':
|
||||||
server()
|
server()
|
||||||
elif sys.argv[1] = '-c':
|
elif sys.argv[1] == '-c':
|
||||||
client()
|
client()
|
||||||
else:
|
else:
|
||||||
usage()
|
usage()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue