#NEWLINE# def _get_project_file( win_id ) : #NEWLINE# #INDENT# session_data = None #NEWLINE# auto_save_session_path = os . path . join ( sublime . packages_path ( ) , '..' , 'Settings' , 'Auto Save Session.sublime_session' ) #NEWLINE# regular_session_path = os . path . join ( sublime . packages_path ( ) , '..' , 'Settings' , 'Session.sublime_session' ) #NEWLINE# for session_path in ( auto_save_session_path , regular_session_path ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# with open ( session_path ) as session_file : #NEWLINE# #INDENT# session_data = json . load ( session_file , strict = False ) #NEWLINE# #UNINDENT# break #NEWLINE# #UNINDENT# except ( IOError , ValueError ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# if ( session_data is None ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# project = ( _find_project_in_data ( session_data , win_id ) or '' ) #NEWLINE# if ( re . match ( '.*\\.sublime-project' , project ) or os . path . exists ( project ) ) : #NEWLINE# #INDENT# return project #NEWLINE# #UNINDENT# return None