mirror of
https://github.com/wassname/pyreadline.git
synced 2026-07-04 17:20:43 +08:00
pyreadline: Warning messages for failed calls to parse_and_bind now disabled by default
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2007-11-28 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu>
|
||||
* Warning messages for failed calls to parse_and_bind now disabled by default
|
||||
Can be enabled by call to debug_output("on_nologfile") in pyreadlineconfig.ini
|
||||
|
||||
2007-11-20 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu>
|
||||
* Applying patch from pan to fix flickering cursor problem when doing input
|
||||
of chinese.
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#*****************************************************************************
|
||||
import unicode_helper,logger,clipboard,lineeditor,modes
|
||||
from rlmain import *
|
||||
import rlmain
|
||||
__all__ = [ 'parse_and_bind',
|
||||
'get_line_buffer',
|
||||
'insert_text',
|
||||
@@ -26,6 +27,8 @@ __all__ = [ 'parse_and_bind',
|
||||
'set_completer_delims',
|
||||
'get_completer_delims',
|
||||
'add_history',
|
||||
'GetOutputFile']
|
||||
'GetOutputFile',
|
||||
'rl',
|
||||
'rlmain']
|
||||
|
||||
import release
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#Bind keys for exit (keys only work on empty lines
|
||||
|
||||
debug_output("off") #"on" saves log info to./pyreadline_debug_log.txt
|
||||
#"on_nologfile" only enables print warning messages
|
||||
bind_exit_key("Control-d")
|
||||
bind_exit_key("Control-z")
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ class Readline(object):
|
||||
self.tabstop = 4
|
||||
self.allow_ctrl_c=False
|
||||
self.ctrl_c_tap_time_interval=0.3
|
||||
self.debug=False
|
||||
|
||||
self.begidx = 0
|
||||
self.endidx = 0
|
||||
@@ -133,7 +134,8 @@ class Readline(object):
|
||||
func = getattr(self.mode, py_name)
|
||||
except AttributeError:
|
||||
log('unknown func key="%s" func="%s"' % (key, func_name))
|
||||
print 'pyeadline parse_and_bind error, unknown function to bind: "%s"' % func_name
|
||||
if self.debug:
|
||||
print 'pyreadline parse_and_bind error, unknown function to bind: "%s"' % func_name
|
||||
return
|
||||
self.mode._bind_key(key, func)
|
||||
except:
|
||||
@@ -362,12 +364,9 @@ class Readline(object):
|
||||
if keyinfo in modes[mode].exit_dispatch:
|
||||
del modes[mode].exit_dispatch[keyinfo]
|
||||
|
||||
|
||||
|
||||
def setkill_ring_to_clipboard(killring):
|
||||
import pyreadline.lineeditor.lineobj
|
||||
pyreadline.lineeditor.lineobj.kill_ring_to_clipboard=killring
|
||||
|
||||
def sethistoryfilename(filename):
|
||||
self._history.history_filename=os.path.expanduser(filename)
|
||||
def setbellstyle(mode):
|
||||
@@ -388,6 +387,8 @@ class Readline(object):
|
||||
def completer_delims(mode):
|
||||
self.completer_delims=mode
|
||||
def debug_output(on,filename="pyreadline_debug_log.txt"): #Not implemented yet
|
||||
if on in ["on","on_nologfile"]:
|
||||
self.debug=True
|
||||
logger.start_log(on,filename)
|
||||
logger.log("STARTING LOG")
|
||||
# print release.branch
|
||||
|
||||
Reference in New Issue
Block a user