SideBar.py 文件源码

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

项目:.sublime 作者: cxdongjack 项目源码 文件源码
def run(self, paths = []):
        items = []
        for item in SideBarSelection(paths).getSelectedImages():
            try:
                image_type, width, height = self.getImageInfo(item.path())
                items.append('<img src="'+item.pathAbsoluteFromProjectEncoded()+'" width="'+str(width)+'" height="'+str(height)+'">')
            except:
                items.append('<img src="'+item.pathAbsoluteFromProjectEncoded()+'">')
        if len(items) > 0:
            sublime.set_clipboard("\n".join(items));
            if len(items) > 1 :
                sublime.status_message("Items copied")
            else :
                sublime.status_message("Item copied")

    # http://stackoverflow.com/questions/8032642/how-to-obtain-image-size-using-standard-python-class-without-using-external-lib
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号