<s> import sublime <EOL> import FuzzyFilePath . common . path as Path <EOL> from FuzzyFilePath . common . config import config <EOL> map_settings = { <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> def project ( window ) : <EOL> """<STR_LIT>""" <EOL> data = window . project_data ( ) <EOL> if not data : <EOL> return False <EOL> changed = False <EOL> settings = data . get ( "<STR_LIT>" , False ) <EOL> if settings is False : <EOL> changed = True <EOL> settings = { } <EOL> data [ "<STR_LIT>" ] = settings <EOL> ffp_project_settings = settings . get ( "<STR_LIT>" ) <EOL> if not ffp_project_settings : <EOL> changed = True <EOL> ffp_project_settings = { } <EOL> settings [ "<STR_LIT>" ] = ffp_project_settings <EOL> if changed : <EOL> window . set_project_data ( data ) <EOL> return ffp_project_settings <EOL> def update ( ) : <EOL> """<STR_LIT>""" <EOL> ffp_settings = sublime . load_settings ( config [ "<STR_LIT>" ] ) <EOL> global_settings = merge ( config , ffp_settings ) <EOL> if global_settings [ "<STR_LIT>" ] : <EOL> global_settings [ "<STR_LIT>" ] = Path . sanitize_base_directory ( global_settings [ "<STR_LIT>" ] ) <EOL> if global_settings [ "<STR_LIT>" ] : <EOL> global_settings [ "<STR_LIT>" ] = Path . sanitize_base_directory ( global_settings [ "<STR_LIT>" ] ) <EOL> return global_settings <EOL> def merge ( settings , overwrite ) : <EOL> """<STR_LIT>""" <EOL> for key in settings : <EOL> settings [ key ] = overwrite . get ( key . lower ( ) , settings [ key ] ) <EOL> for key in map_settings : <EOL> mappedKey = map_settings [ key ] <EOL> settings [ key ] = overwrite . get ( mappedKey , settings [ key ] ) <EOL> return settings </s>
