#NEWLINE# def get_nim_project( window , view ) : #NEWLINE# #INDENT# '\n    Given a window and view, return the Nim project associated with it.\n    :type window: sublime.Window\n    :type view: sublime.View\n    :rtype: str\n    ' #NEWLINE# st_project = _get_project_file ( window . id ( ) ) #NEWLINE# result = view . file_name ( ) #NEWLINE# if ( st_project is not None ) : #NEWLINE# #INDENT# with open ( st_project ) as project_file : #NEWLINE# #INDENT# data = json . loads ( project_file . read ( ) ) #NEWLINE# try : #NEWLINE# #INDENT# path = data [ 'settings' ] [ 'nim-project' ] #NEWLINE# directory = os . path . dirname ( st_project ) #NEWLINE# path = path . replace ( '/' , os . sep ) #NEWLINE# result = os . path . join ( directory , path ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return result