search.py 文件源码

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

项目:specto 作者: mrknow 项目源码 文件源码
def handleAction(self, action, query=None):
        """Handle action from context menu on query."""
        if action == 'remove':
            if query and query in self.history:
                index = self.history.index(query)
                del self.history[index]
                self.updateHistory(select=index-1)  
        elif action == 'rename':
            if query and query in self.history:
                text = self.inputText(text=query, title=_('Edit search'))
                if text and text != query:
                    index = self.history.index(query)
                    self.history[index] = text
                    self.updateHistory(select=index)
        elif action == 'clean':
            if self.history:
                self.history = []
                self.updateHistory()
        else:
            xbmcgui.Dialog().ok('Action', 'Unknown action', action)
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号