# Path: plugins/lib/view_utils.py
# def get_text(view):
#     """Returns the whole string of a buffer. Alias for `coorded_substr(view)`.
#     """
#     return coorded_substr(view)
# 
# Path: plugins/lib/fileconv/dumpers.py
# class DumperProto(object):
# class JSONDumper(DumperProto):
# class PlistDumper(DumperProto):
# class YAMLDumper(DumperProto):
#     def __init__(self, window, view, new_file_path, output=None, file_path=None, *args, **kwargs):
#     def validate_data(self, data, *args, **kwargs):
#     def _validate_data(self, data, funcs):
#         def check_recursive(obj):
#     def validate_params(self, params):
#     def dump(self, data, *args, **kwargs):
#     def write(self, data, *args, **kwargs):
#     def validate_data(self, data):
#     def write(self, data, params, *args, **kwargs):
#     def validate_data(self, data):
#     def write(self, data, params, *args, **kwargs):
#     def validate_data(self, data):
#     def write(self, data, params, *args, **kwargs):
# 
# Path: plugins/lib/fileconv/loaders.py
# def strip_js_comments(string):
#     def __init__(self, window, view, file_path=None, output=None, *args, **kwargs):
#     def _pre_init_(cls):
#     def get_ext_appendix(cls, file_name):
#     def get_new_file_ext(cls, view, file_path=None):
#     def new_file_ext(self):
#     def load_options(self, view):
#     def get_options(self):
#     def file_is_valid(cls, view, file_path=None):
#     def is_valid(self):
#     def load(self, *args, **kwargs):
#     def parse(self, *args, **kwargs):
#     def parse(self, *args, **kwargs):
#     def file_is_valid(cls, view, file_path=None):
#     def parse(self, *args, **kwargs):
#     def parse(self, *args, **kwargs):
# class LoaderProto(object):
# class JSONLoader(LoaderProto):
# class PlistLoader(LoaderProto):
# class YAMLLoader(LoaderProto):
#     DOCTYPE = "<!DOCTYPE plist"


import os
import time
import sublime
import sublime_plugin
from sublime_lib import OutputPanel
from pathlib import Path
from .lib.view_utils import get_text
from .lib.fileconv import dumpers, loaders
        # Check the environment (view, args, ...)
        if self.view.is_dirty():
            # Save the file so that source and target file on the drive don't differ
            self.view.run_command("save")
            if self.view.is_dirty():
                return sublime.error_message("The file could not be saved correctly. "
                                             "The build was aborted")

        file_path = self.view.file_name()
        if not file_path:
            return self.status("File does not exist.", file_path)
        file_path = Path(file_path)

        if source_format and target_format == source_format:
            return self.status("Target and source file format are identical. (%s)" % target_format)

        if source_format and source_format not in loaders.get:
            return self.status("Loader for '%s' not supported/implemented." % source_format)

        if target_format and target_format not in dumpers.get:
            return self.status("Dumper for '%s' not supported/implemented." % target_format)

        # Now the actual "building" starts (collecting remaining parameters)
        with OutputPanel.create(self.window, "package_dev",
                                read_only=True, force_writes=True) as output:
            output.show()

            # Auto-detect the file type if it's not specified
            if not source_format:
                output.write("Input type not specified, auto-detecting...")

# Path: plugins/lib/view_utils.py
# def get_text(view):
#     """Returns the whole string of a buffer. Alias for `coorded_substr(view)`.
#     """
#     return coorded_substr(view)
# 
# Path: plugins/lib/fileconv/dumpers.py
# class DumperProto(object):
# class JSONDumper(DumperProto):
# class PlistDumper(DumperProto):
# class YAMLDumper(DumperProto):
#     def __init__(self, window, view, new_file_path, output=None, file_path=None, *args, **kwargs):
#     def validate_data(self, data, *args, **kwargs):
#     def _validate_data(self, data, funcs):
#         def check_recursive(obj):
#     def validate_params(self, params):
#     def dump(self, data, *args, **kwargs):
#     def write(self, data, *args, **kwargs):
#     def validate_data(self, data):
#     def write(self, data, params, *args, **kwargs):
#     def validate_data(self, data):
#     def write(self, data, params, *args, **kwargs):
#     def validate_data(self, data):
#     def write(self, data, params, *args, **kwargs):
# 
# Path: plugins/lib/fileconv/loaders.py
# def strip_js_comments(string):
#     def __init__(self, window, view, file_path=None, output=None, *args, **kwargs):
#     def _pre_init_(cls):
#     def get_ext_appendix(cls, file_name):
#     def get_new_file_ext(cls, view, file_path=None):
#     def new_file_ext(self):
#     def load_options(self, view):
#     def get_options(self):
#     def file_is_valid(cls, view, file_path=None):
#     def is_valid(self):
#     def load(self, *args, **kwargs):
#     def parse(self, *args, **kwargs):
#     def parse(self, *args, **kwargs):
#     def file_is_valid(cls, view, file_path=None):
#     def parse(self, *args, **kwargs):
#     def parse(self, *args, **kwargs):
# class LoaderProto(object):
# class JSONLoader(LoaderProto):
# class PlistLoader(LoaderProto):
# class YAMLLoader(LoaderProto):
#     DOCTYPE = "<!DOCTYPE plist"


# Path: plugins/file_conversion.py
import os
import time
import sublime
import sublime_plugin
from sublime_lib import OutputPanel
from pathlib import Path
from .lib.view_utils import get_text
from .lib.fileconv import dumpers, loaders

        # Check the environment (view, args, ...)
        if self.view.is_dirty():
            # Save the file so that source and target file on the drive don't differ
            self.view.run_command("save")
            if self.view.is_dirty():
                return sublime.error_message("The file could not be saved correctly. "
                                             "The build was aborted")

        file_path = self.view.file_name()
        if not file_path:
            return self.status("File does not exist.", file_path)
        file_path = Path(file_path)

        if source_format and target_format == source_format:
            return self.status("Target and source file format are identical. (%s)" % target_format)

        if source_format and source_format not in loaders.get:
            return self.status("Loader for '%s' not supported/implemented." % source_format)

        if target_format and target_format not in dumpers.get:
            return self.status("Dumper for '%s' not supported/implemented." % target_format)

        # Now the actual "building" starts (collecting remaining parameters)
        with OutputPanel.create(self.window, "package_dev",
                                read_only=True, force_writes=True) as output:
            output.show()

            # Auto-detect the file type if it's not specified
            if not source_format:
                output.write("Input type not specified, auto-detecting...")

                for Loader in loaders.get.values():