<s> import os <EOL> import sublime <EOL> def get_plugin_path ( ) : <EOL> '''<STR_LIT>''' <EOL> plugin_path = os . path . abspath ( <EOL> os . path . join ( sublime . packages_path ( ) , '<STR_LIT>' ) ) <EOL> return plugin_path <EOL> def get_ycmd_path ( ) : <EOL> '''<STR_LIT>''' <EOL> settings = sublime . load_settings ( '<STR_LIT>' ) <EOL> ycmd_path = settings . get ( '<STR_LIT>' , os . path . join ( <EOL> get_plugin_path ( ) , '<STR_LIT>' ) ) <EOL> ycmd_path = os . path . join ( ycmd_path , '<STR_LIT>' ) <EOL> return ycmd_path <EOL> def get_python_path ( ) : <EOL> '''<STR_LIT>''' <EOL> settings = sublime . load_settings ( '<STR_LIT>' ) <EOL> python_path = settings . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> return python_path <EOL> def get_file_path ( filepath = None ) : <EOL> '''<STR_LIT>''' <EOL> if not filepath : <EOL> filepath = active_view ( ) . file_name ( ) <EOL> if not filepath : <EOL> filepath = '<STR_LIT>' <EOL> return filepath <EOL> def get_error_panel_syntax_file ( ) : <EOL> settings = sublime . load_settings ( '<STR_LIT>' ) <EOL> filepath = settings . get ( '<STR_LIT>' , os . path . join ( <EOL> get_plugin_path ( ) , '<STR_LIT>' ) ) <EOL> return filepath <EOL> def check_highlight_on_save ( ) : <EOL> '''<STR_LIT>''' <EOL> settings = sublime . load_settings ( '<STR_LIT>' ) <EOL> rst = settings . get ( '<STR_LIT>' , False ) <EOL> return rst <EOL> def check_select_after_goto ( ) : <EOL> '''<STR_LIT>''' <EOL> settings = sublime . load_settings ( '<STR_LIT>' ) <EOL> rst = settings . get ( '<STR_LIT>' , False ) <EOL> return rst <EOL> def check_ycmd_server ( ) : <EOL> '''<STR_LIT>''' <EOL> return os . path . exists ( get_ycmd_path ( ) ) <EOL> def find_recursive ( path ) : <EOL> '''<STR_LIT>''' <EOL> path = os . path . dirname ( path ) <EOL> while ( True ) : <EOL> if os . path . exists ( os . path . join ( path , '<STR_LIT>' ) ) : <EOL> return os . path . join ( path , '<STR_LIT>' ) <EOL> parent_dir = os . path . dirname ( path ) <EOL> if parent_dir == path : <EOL> break <EOL> else : <EOL> path = parent_dir <EOL> return None <EOL> def is_cpp ( view ) : <EOL> '''<STR_LIT>''' <EOL> try : <EOL> return view . match_selector ( view . sel ( ) [ <NUM_LIT:0> ] . begin ( ) , '<STR_LIT>' ) <EOL> except : <EOL> return False <EOL> def active_view ( ) : <EOL> '''<STR_LIT>''' <EOL> return sublime . active_window ( ) . active_view ( ) <EOL> def get_row_col ( view , location = None ) : <EOL> '''<STR_LIT>''' <EOL> try : <EOL> if not location : <EOL> location = view . sel ( ) [ <NUM_LIT:0> ] . begin ( ) <EOL> row , col = view . rowcol ( location ) <EOL> return ( row + <NUM_LIT:1> , col + <NUM_LIT:1> ) <EOL> except : <EOL> return None </s>
