AtrophyCompleter.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Atrophy 作者: Thiefyface 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号