text_editor_hastebin.py 文件源码

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

项目:bpy_lambda 作者: bcongdon 项目源码 文件源码
def invoke(self, context, event):
        import webbrowser
        st = context.space_data

        # get the selected text
        text = self.get_selected_text(st.text)
        # if no text is selected send the whole file
        if text is None: text = st.text.as_string()

        # send the text and receive the returned page
        page = self.send_text(text)

        if page is None:
            return {'CANCELLED'}

        # store the link in the clipboard
        bpy.context.window_manager.clipboard = page

        if context.scene.use_webbrowser:
            try:
                webbrowser.open_new_tab(page)
            except:
                self.report({'WARNING'}, "Error in opening the page %s." % (page))

        return {'FINISHED'}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号