docphp.py 文件源码

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

项目:docphp 作者: garveen 项目源码 文件源码
def on_navigate(self, url):
        if re.search('^https?://', url):
            webbrowser.open_new(url)
            return True

        m = re.search('^(changeto|constant)\.(.*)', url)
        if m:
            if m.group(1) == 'changeto':
                symbol, content = getSymbolDescription(self.currentSymbol, m.group(2))
            else:
                self.view.run_command('docphp_insert', {"string": m.group(2)})
                self.view.hide_popup()

        elif url == 'history.back':
            symbol = self.history.pop()
            self.currentSymbol = symbol
        else:
            self.history.append(self.currentSymbol)
            symbol = url[:url.find('.html')]
            self.currentSymbol = symbol
        symbol, content = getSymbolDescription(symbol)

        if content == False:
            return False

        content = self.formatPopup(content, symbol=symbol, can_back=len(self.history) > 0)

        content = content[:65535]
        self.view.update_popup(content)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号