mirror of
https://github.com/wassname/pyreadline.git
synced 2026-08-09 12:20:23 +08:00
Changed all strings to unicodestrings
This commit is contained in:
+12
-12
@@ -15,11 +15,11 @@ try:
|
||||
import msvcrt
|
||||
except ImportError:
|
||||
msvcrt=None
|
||||
print "problem"
|
||||
print u"problem"
|
||||
|
||||
|
||||
port=logging.handlers.DEFAULT_TCP_LOGGING_PORT
|
||||
host='localhost'
|
||||
host=u'localhost'
|
||||
|
||||
def check_key():
|
||||
if msvcrt is None:
|
||||
@@ -28,18 +28,18 @@ def check_key():
|
||||
if msvcrt.kbhit()!=0:
|
||||
q=msvcrt.getch()
|
||||
return q
|
||||
return ""
|
||||
return u""
|
||||
|
||||
|
||||
singleline=False
|
||||
|
||||
def main():
|
||||
print "Starting TCP logserver on port:",port
|
||||
print "Press q to quit logserver", port
|
||||
print "Press c to clear screen", port
|
||||
print u"Starting TCP logserver on port:",port
|
||||
print u"Press q to quit logserver", port
|
||||
print u"Press c to clear screen", port
|
||||
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
|
||||
|
||||
s.bind(("",port))
|
||||
s.bind((u"",port))
|
||||
s.settimeout(1)
|
||||
while 1:
|
||||
try:
|
||||
@@ -47,11 +47,11 @@ def main():
|
||||
print data,
|
||||
except socket.timeout:
|
||||
key=check_key().lower()
|
||||
if "q"==key:
|
||||
print "Quitting logserver"
|
||||
if u"q"==key:
|
||||
print u"Quitting logserver"
|
||||
break
|
||||
elif "c" == key:
|
||||
print "\n"*100
|
||||
elif u"c" == key:
|
||||
print u"\n"*100
|
||||
|
||||
if __name__ == "__main__":
|
||||
if __name__ == u"__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user