def __init__(self,cmdcomplete,init_flag=True):
self.text = ""
self.matches = []
self.cmdcomplete = cmdcomplete
self.symbols = []
self.index = 0
self.cleanup_flag = True
self.init_flag = init_flag
self.session_start_index = 0
self.HISTLEN = 2000
self.HISTFILE = ".atrophy-history"
self.DEFAULT_HIST_DISPLAY_LEN = 20
self.delims = readline.get_completer_delims()
readline.set_completer_delims(self.delims.replace("/",''))
self.delims = readline.get_completer_delims()
readline.set_completer_delims(self.delims.replace("?",''))
self.delims = readline.get_completer_delims()
readline.set_completer_delims(self.delims.replace("@",''))
readline.parse_and_bind('tab: complete')
readline.set_completer(self.complete)
# persistant commands that actually affect a session
# (e.g. breakpoints, mem writes, comments)
self.project_cmds = [ "sd", "b", "db", "sb","#", "//" ]
if self.init_flag == True:
self.init_flag = False
try:
readline.read_history_file(self.HISTFILE)
self.session_start_index = readline.get_current_history_length()
readline.set_history_length(self.HISTLEN)
except Exception as e:
pass
atexit.register(self.on_exit,self.HISTFILE)
评论列表
文章目录