#NEWLINE# def refresh_library_paths( self , from_global = None ) : #NEWLINE# #INDENT# if ( from_global is None ) : #NEWLINE# #INDENT# self . refresh_library_paths ( True ) #NEWLINE# self . refresh_library_paths ( False ) #NEWLINE# return #NEWLINE# #UNINDENT# previous_menu = ( 'global_settings' if from_global else 'project_settings' ) #NEWLINE# library_paths_menu = { #NEWLINE# #INDENT# 'selected_index' : 2 , #NEWLINE# 'items' : [ [ 'Back' , 'Back to previous menu' ] , [ 'Add Library Path' , 'Add a library path to be used when run the program' ] ] , #NEWLINE# 'actions' : [ { #NEWLINE# #INDENT# 'name' : previous_menu , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'command' : 'javatar_project_settings' , #NEWLINE# 'args' : { #NEWLINE# #INDENT# 'action_type' : 'add_library_path' , #NEWLINE# 'to_global' : from_global , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# library_paths = self . get_library_paths ( from_global , True ) #NEWLINE# for library_path in library_paths : #NEWLINE# #INDENT# name = os . path . basename ( library_path [ 0 ] ) #NEWLINE# if library_path [ 1 ] : #NEWLINE# #INDENT# library_paths_menu [ 'actions' ] . append ( { #NEWLINE# #INDENT# 'command' : 'javatar_project_settings' , #NEWLINE# 'args' : { #NEWLINE# #INDENT# 'action_type' : 'remove_library_path' , #NEWLINE# 'library_path' : library_path [ 0 ] , #NEWLINE# 'from_global' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( not os . path . exists ( library_path [ 0 ] ) ) : #NEWLINE# #INDENT# library_paths_menu [ 'items' ] . append ( [ ( '[Missing] ' + name ) , 'Global library path. Select to remove from the list' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . path . isdir ( library_path [ 0 ] ) : #NEWLINE# #INDENT# library_paths_menu [ 'items' ] . append ( [ ( ( '[' + name ) + ']' ) , 'Global library path. Select to remove from the list' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# library_paths_menu [ 'items' ] . append ( [ name , 'Global library path. Select to remove from the list' ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# library_paths_menu [ 'actions' ] . append ( { #NEWLINE# #INDENT# 'command' : 'javatar_project_settings' , #NEWLINE# 'args' : { #NEWLINE# #INDENT# 'action_type' : 'remove_library_path' , #NEWLINE# 'library_path' : library_path [ 0 ] , #NEWLINE# 'from_global' : False , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( not os . path . exists ( library_path [ 0 ] ) ) : #NEWLINE# #INDENT# library_paths_menu [ 'items' ] . append ( [ ( '[Missing] ' + name ) , 'Project library path. Select to remove from the list' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . path . isdir ( library_path [ 0 ] ) : #NEWLINE# #INDENT# library_paths_menu [ 'items' ] . append ( [ ( ( '[' + name ) + ']' ) , 'Project library path. Select to remove from the list' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# library_paths_menu [ 'items' ] . append ( [ name , 'Project library path. Select to remove from the list' ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# menu_name = '_library_paths' #NEWLINE# if from_global : #NEWLINE# #INDENT# menu_name = ( 'global' + menu_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# menu_name = ( 'local' + menu_name ) #NEWLINE# #UNINDENT# sublime . active_window ( ) . run_command ( 'javatar' , { #NEWLINE# #INDENT# 'replaceMenu' : { #NEWLINE# #INDENT# 'name' : menu_name , #NEWLINE# 'menu' : library_paths_menu , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } )