def complete(self,text,index):
if text != self.text or not text:
self.text = text
if not readline.get_begidx():
self.matches = [ w for w in self.cmdcomplete if w.startswith(text) ]
else:
context = readline.get_line_buffer().split(" ")
#check first word, see if it's an atrophy command
if context[0] in self.cmdcomplete and context[0] != "run":
self.matches = [ s for s in self.symbols if s.startswith(text)]
else:
self.matches = [ f for f in glob.glob(context[-1]+'*')]
else:
try:
return self.matches[index]
except:
pass
try:
return self.matches[index]
except:
return None
评论列表
文章目录