prompt_open_recent_project.py 文件源码

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

项目:st-user-package 作者: math2001 项目源码 文件源码
def load_session(self):
        """
        Returns dict or None if no session exists
        """

        local_session_path = os.path.join(os.path.dirname(sublime.packages_path()), 'Local')
        local_auto_save_session_file = os.path.join(local_session_path, 'Auto Save Session.sublime_session')
        local_session_file = os.path.join(local_session_path, 'Session.sublime_session')

        if os.path.isfile(local_auto_save_session_file):
            session_file_to_use = local_auto_save_session_file
        elif os.path.isfile(local_session_file):
            session_file_to_use = local_session_file
        else:
            return None

        with open(session_file_to_use) as f:
            local_session_content = f.read()

        session = json.loads(local_session_content, strict=False)

        return session
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号