# Path: lib/utils/debug.py
# def Debug(classification, text):
#     if 'all' in print_classifications or classification in print_classifications:
#         print("ArcticTypescript: %s: %s" % (classification.ljust(8), text))
#     if classification not in possible_classifications:
#         print("ArcticTypescript: debug: got unknown debug message classification: %s. " \
#             "Consider adding this to possible_classifications" % classification)
#     sys.stdout.flush()
# 
# Path: lib/system/globals.py
# OPENED_PROJECTS = {}


import sublime
import os
from .debug import Debug
from ..system.globals import plugin_disabled_for_folders
# coding=utf8




# ############## Allows Disabling of ArcticTypescript ######################


# has a global variable in globals.py


def is_plugin_globally_disabled():
    return "*global" in plugin_disabled_for_folders

def is_plugin_temporarily_disabled(folder=None):
    """ Returns True if the plugin is disabled globally or for folder.
        Folder can be a view """
    if is_plugin_globally_disabled() or folder is None:
        return is_plugin_globally_disabled()
    if folder is not None and isinstance(folder, sublime.View):
        if folder.file_name() is None:
            return is_plugin_globally_disabled()
        folder = os.path.dirname(folder.file_name())
    folder = os.path.normcase(folder)

# Path: lib/utils/debug.py
# def Debug(classification, text):
#     if 'all' in print_classifications or classification in print_classifications:
#         print("ArcticTypescript: %s: %s" % (classification.ljust(8), text))
#     if classification not in possible_classifications:
#         print("ArcticTypescript: debug: got unknown debug message classification: %s. " \
#             "Consider adding this to possible_classifications" % classification)
#     sys.stdout.flush()
# 
# Path: lib/system/globals.py
# OPENED_PROJECTS = {}


# Path: lib/utils/disabling.py
import sublime
import os
from .debug import Debug
from ..system.globals import plugin_disabled_for_folders

# coding=utf8




# ############## Allows Disabling of ArcticTypescript ######################


# has a global variable in globals.py


def is_plugin_globally_disabled():
    return "*global" in plugin_disabled_for_folders

def is_plugin_temporarily_disabled(folder=None):
    """ Returns True if the plugin is disabled globally or for folder.
        Folder can be a view """
    if is_plugin_globally_disabled() or folder is None:
        return is_plugin_globally_disabled()
    if folder is not None and isinstance(folder, sublime.View):
        if folder.file_name() is None:
            return is_plugin_globally_disabled()
        folder = os.path.dirname(folder.file_name())
    folder = os.path.normcase(folder)

    return folder in plugin_disabled_for_folders