apply 2to3.py

$ python-3.2 2to3.py -w .
This commit is contained in:
shimizukawa
2011-03-30 00:26:30 +09:00
parent 75dcc77771
commit a0b0db4057
41 changed files with 4752 additions and 4749 deletions
+15 -15
View File
@@ -5,21 +5,21 @@
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#*****************************************************************************
import cPickle
import pickle
import logging
import logging.handlers
import SocketServer
import socketserver
import struct,socket
try:
import msvcrt
except ImportError:
msvcrt = None
print u"problem"
print("problem")
port = logging.handlers.DEFAULT_TCP_LOGGING_PORT
host = u'localhost'
host = 'localhost'
def check_key():
if msvcrt is None:
@@ -28,30 +28,30 @@ def check_key():
if msvcrt.kbhit() != 0:
q = msvcrt.getch()
return q
return u""
return ""
singleline=False
def main():
print u"Starting TCP logserver on port:", port
print u"Press q to quit logserver", port
print u"Press c to clear screen", port
print("Starting TCP logserver on port:", port)
print("Press q to quit logserver", port)
print("Press c to clear screen", port)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((u"", port))
s.bind(("", port))
s.settimeout(1)
while 1:
try:
data, addr = s.recvfrom(100000)
print data,
print(data, end=' ')
except socket.timeout:
key = check_key().lower()
if u"q" == key:
print u"Quitting logserver"
if "q" == key:
print("Quitting logserver")
break
elif u"c" == key:
print u"\n" * 100
elif "c" == key:
print("\n" * 100)
if __name__ == u"__main__":
if __name__ == "__main__":
main()