# Path: src/libs/util.py
# def download_and_save(url, destination_path) :
# def open_json(path):
# def check_thread_is_alive(thread_name) :
# def create_and_start_thread(target, thread_name="", args=[], kwargs={}, daemon=True) :
# def check_process_is_alive(process_name) :
# def create_and_start_process(target, process_name="", args=[], kwargs={}, daemon=True) :
# def set_timeout(time, func):
# def checksum_sha1(fname):
# def checksum_sha1_equalcompare(fname1, fname2):
# def split_string_and_find(string_to_split, search_value, split_delimiter=" ") :
# def split_string_and_find_on_multiple(string_to_split, search_values, split_delimiter=" ") :
# def split_string_and_findLast(string_to_split, search_value, split_delimiter=" ") :
# def index_of(list_to_search, search_value) :
# def last_index_of(list_to_search, search_value) :
# def first_index_of_multiple(list_to_search, search_values) :
# def find_and_get_pre_string_and_first_match(string, search_value) :
# def find_and_get_pre_string_and_matches(string, search_value) :
# def get_region_scope_first_match(view, scope, selection, selector) :
# def get_region_scope_last_match(view, scope, selection, selector) :
# def find_regions_on_same_depth_level(view, scope, selection, selectors, depth_level, forward) :
# def get_current_region_scope(view, selection) :
# def get_parent_region_scope(view, selection) :
# def get_specified_parent_region_scope(view, selection, parent) :
# def region_contains_scope(view, region, scope) :
# def cover_regions(regions) :
# def rowcol_to_region(view, row, endrow, col, endcol):
# def trim_region(view, region):
# def prev_line_is_empty(view, region):
# def next_line_is_empty(view, region):
# def selection_in_js_scope(view, point = -1, except_for = ""):
# def replace_with_tab(view, region, pre="", after="", add_to_each_line_before="", add_to_each_line_after="", lstrip=False) :
# def replace_without_tab(view, region, pre="", after="", add_to_each_line_before="", add_to_each_line_after="", lstrip=False) :
# def get_whitespace_from_line_begin(view, region) :
# def add_whitespace_indentation(view, region, string, replace="\t", add_whitespace_end=True) :
# def convert_tabs_using_tab_size(view, string):
# def go_to_centered(view, row, col):
# def wait_view(view, fun):
# def move_content_to_parent_folder(path):
# def merge_dicts(*dict_args):
# def removeItemIfExists(arr, item):
# def getListItemIfExists(arr, item):
# def delItemIfExists(obj, key):
# def getDictItemIfExists(obj, key):
# def create_and_show_panel(output_panel_name, window=None, syntax="", read_only=False, return_if_exists=False, unlisted=False):
# def split_path(path):
# def convert_path_to_unix(path):
# def execute(command, command_args, chdir="", wait_terminate=True, func_stdout=None, args_func_stdout=[]) :
# def _wrapper_func_stdout(args, func_stdout, args_func_stdout=[], chdir=""):
# def _wrapper_func_stdout_listen_output(process, func_stdout=None, args_func_stdout=[], lines_output=[]):
# def _wrapper_func_stdout_listen_error(process, func_stdout=None, args_func_stdout=[], lines_error=[]):
# def nested_lookup(key, values, document, wild=False, return_parent=False):
# def _nested_lookup(key, values, document, wild=False, return_parent=False):
# def sublime_executable_path():
# def subl(args):
# def overwrite_default_javascript_snippet():
# def open_project_folder(project):
# def is_project_open(project): 
# def is_javascript_project():
# def is_type_javascript_project(type):
# def is_project_view(view) :
# def get_project_settings(project_dir_name = ""):
# def save_project_setting(setting_file, data):
# def word_with_dollar_char(view, region_or_point):


import sublime, sublime_plugin
from ...libs import util

class JavascriptEnhancementsBuildFlowOnSaveEventListener(sublime_plugin.EventListener):

  def on_post_save_async(self, view):
    settings = util.get_project_settings()

# Path: src/libs/util.py
# def download_and_save(url, destination_path) :
# def open_json(path):
# def check_thread_is_alive(thread_name) :
# def create_and_start_thread(target, thread_name="", args=[], kwargs={}, daemon=True) :
# def check_process_is_alive(process_name) :
# def create_and_start_process(target, process_name="", args=[], kwargs={}, daemon=True) :
# def set_timeout(time, func):
# def checksum_sha1(fname):
# def checksum_sha1_equalcompare(fname1, fname2):
# def split_string_and_find(string_to_split, search_value, split_delimiter=" ") :
# def split_string_and_find_on_multiple(string_to_split, search_values, split_delimiter=" ") :
# def split_string_and_findLast(string_to_split, search_value, split_delimiter=" ") :
# def index_of(list_to_search, search_value) :
# def last_index_of(list_to_search, search_value) :
# def first_index_of_multiple(list_to_search, search_values) :
# def find_and_get_pre_string_and_first_match(string, search_value) :
# def find_and_get_pre_string_and_matches(string, search_value) :
# def get_region_scope_first_match(view, scope, selection, selector) :
# def get_region_scope_last_match(view, scope, selection, selector) :
# def find_regions_on_same_depth_level(view, scope, selection, selectors, depth_level, forward) :
# def get_current_region_scope(view, selection) :
# def get_parent_region_scope(view, selection) :
# def get_specified_parent_region_scope(view, selection, parent) :
# def region_contains_scope(view, region, scope) :
# def cover_regions(regions) :
# def rowcol_to_region(view, row, endrow, col, endcol):
# def trim_region(view, region):
# def prev_line_is_empty(view, region):
# def next_line_is_empty(view, region):
# def selection_in_js_scope(view, point = -1, except_for = ""):
# def replace_with_tab(view, region, pre="", after="", add_to_each_line_before="", add_to_each_line_after="", lstrip=False) :
# def replace_without_tab(view, region, pre="", after="", add_to_each_line_before="", add_to_each_line_after="", lstrip=False) :
# def get_whitespace_from_line_begin(view, region) :
# def add_whitespace_indentation(view, region, string, replace="\t", add_whitespace_end=True) :
# def convert_tabs_using_tab_size(view, string):
# def go_to_centered(view, row, col):
# def wait_view(view, fun):
# def move_content_to_parent_folder(path):
# def merge_dicts(*dict_args):
# def removeItemIfExists(arr, item):
# def getListItemIfExists(arr, item):
# def delItemIfExists(obj, key):
# def getDictItemIfExists(obj, key):
# def create_and_show_panel(output_panel_name, window=None, syntax="", read_only=False, return_if_exists=False, unlisted=False):
# def split_path(path):
# def convert_path_to_unix(path):
# def execute(command, command_args, chdir="", wait_terminate=True, func_stdout=None, args_func_stdout=[]) :
# def _wrapper_func_stdout(args, func_stdout, args_func_stdout=[], chdir=""):
# def _wrapper_func_stdout_listen_output(process, func_stdout=None, args_func_stdout=[], lines_output=[]):
# def _wrapper_func_stdout_listen_error(process, func_stdout=None, args_func_stdout=[], lines_error=[]):
# def nested_lookup(key, values, document, wild=False, return_parent=False):
# def _nested_lookup(key, values, document, wild=False, return_parent=False):
# def sublime_executable_path():
# def subl(args):
# def overwrite_default_javascript_snippet():
# def open_project_folder(project):
# def is_project_open(project): 
# def is_javascript_project():
# def is_type_javascript_project(type):
# def is_project_view(view) :
# def get_project_settings(project_dir_name = ""):
# def save_project_setting(setting_file, data):
# def word_with_dollar_char(view, region_or_point):


# Path: src/listeners/flow/build_on_save.py
import sublime, sublime_plugin
from ...libs import util


class JavascriptEnhancementsBuildFlowOnSaveEventListener(sublime_plugin.EventListener):

  def on_post_save_async(self, view):
    settings = util.get_project_settings()

    if util.selection_in_js_scope(view) and settings and settings["project_settings"]["build_flow"]["on_save"] and len(settings["project_settings"]["build_flow"]["source_folders"]) > 0 and settings["project_settings"]["build_flow"]["destination_folder"] :