mirror of
https://github.com/wassname/pyreadline.git
synced 2026-07-17 01:30:27 +08:00
Fixing wide character related bugs
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2007-10-30 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu>
|
||||
* Fixing console.title to work with wide characters
|
||||
* Fixing wide character bug for log_sock
|
||||
|
||||
2007-10-30 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu>
|
||||
* Add tests for history buffer. Add ignore_leading_spaces option for
|
||||
history searches for forward_search_history, and reverse_search_history.
|
||||
|
||||
@@ -553,7 +553,7 @@ class Console(object):
|
||||
if txt:
|
||||
self.SetConsoleTitleW(txt)
|
||||
else:
|
||||
buffer = c_buffer(200)
|
||||
buffer = create_unicode_buffer(200)
|
||||
n = self.GetConsoleTitleW(buffer, 200)
|
||||
if n > 0:
|
||||
return buffer.value[:n]
|
||||
@@ -596,6 +596,8 @@ class Console(object):
|
||||
# add the functions from the dll to the class
|
||||
for func in funcs:
|
||||
setattr(Console, func, getattr(windll.kernel32, func))
|
||||
windll.kernel32.SetConsoleTitleW.argtypes=[c_wchar_p]
|
||||
windll.kernel32.GetConsoleTitleW.argtypes=[c_wchar_p,c_short]
|
||||
|
||||
from event import Event
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ def log_sock(s,event_type=None):
|
||||
pass
|
||||
else:
|
||||
if event_type is None:
|
||||
logsocket.sendto(s,(host,port))
|
||||
logsocket.sendto(str(s),(host,port))
|
||||
elif event_type in show_event:
|
||||
logsocket.sendto(s,(host,port))
|
||||
logsocket.sendto(str(s),(host,port))
|
||||
else:
|
||||
pass
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class EmacsMode(basemode.BaseMode):
|
||||
dispatch_func = self.key_dispatch.get(keyinfo,default)
|
||||
|
||||
log("readline from keyboard:%s,%s"%(keyinfo,dispatch_func))
|
||||
log_sock("%s|%s"%(format(keyinfo),dispatch_func.__name__),"bound_function")
|
||||
log_sock(("%s|%s"%(format(keyinfo),dispatch_func.__name__)).encode(sys.stdout.encoding),"bound_function")
|
||||
r = None
|
||||
if dispatch_func:
|
||||
r = dispatch_func(event)
|
||||
|
||||
Reference in New Issue
Block a user