# 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()
# 
# def max_calls(limit = 1500, name=""):
#     """Decorator which allows its wrapped function to be called `limit` times"""
#     def decorator(func):
#         # Disable limit:
#         return func
#         @wraps(func)
#         def wrapper(*args, **kwargs):
#             calls = getattr(wrapper, 'calls', 0)
#             calls += 1
#             setattr(wrapper, 'calls', calls)
#             fname = name if name != "" else func.__name__
# 
#             if calls == limit + 1:
#                 Debug('max_calls', "LIMIT !! ## !!: Fkt %s has %i calls, stop" % (fname, calls - 1))
# 
#             if calls >= limit + 1:
#                 return None
# 
#             Debug('max_calls', "CALL: Fkt %s has %i calls -> +1" % (fname, calls - 1))
# 
#             return func(*args, **kwargs)
#         setattr(wrapper, 'calls', 0)
#         return wrapper
#     return decorator


import sublime
from ..utils import max_calls, Debug
        window.focus_group(min(active_group, num_groups-1))


    # ADD VIEW
    def add_view(self,window,view,group):
        window.set_view_index(view, group, 0)


    # CREATE PANE
    @max_calls(name='Layout.create')
    def create(self,window):
        rows, cols, cells = self.get_layout(window)
        if rows is None:
            rows, cols, cells = self.get_layout(window)
            if rows is None:
                return


        MAXROWS = len(rows)-1
        MAXCOLS = len(cols)-1

        cols[MAXCOLS] = cols[MAXCOLS-1]+(cols[MAXCOLS]-cols[MAXCOLS-1])*0.65
        cols.append(1.0)
        cells.append([MAXCOLS,0,MAXCOLS+1,MAXROWS])

        layout = {"cols": cols, "rows": rows, "cells": cells}
        self.set_layout(window, layout)


    # DELETE

# 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()
# 
# def max_calls(limit = 1500, name=""):
#     """Decorator which allows its wrapped function to be called `limit` times"""
#     def decorator(func):
#         # Disable limit:
#         return func
#         @wraps(func)
#         def wrapper(*args, **kwargs):
#             calls = getattr(wrapper, 'calls', 0)
#             calls += 1
#             setattr(wrapper, 'calls', calls)
#             fname = name if name != "" else func.__name__
# 
#             if calls == limit + 1:
#                 Debug('max_calls', "LIMIT !! ## !!: Fkt %s has %i calls, stop" % (fname, calls - 1))
# 
#             if calls >= limit + 1:
#                 return None
# 
#             Debug('max_calls', "CALL: Fkt %s has %i calls -> +1" % (fname, calls - 1))
# 
#             return func(*args, **kwargs)
#         setattr(wrapper, 'calls', 0)
#         return wrapper
#     return decorator


# Path: lib/display/Layout.py
import sublime
from ..utils import max_calls, Debug

        window.focus_group(min(active_group, num_groups-1))


    # ADD VIEW
    def add_view(self,window,view,group):
        window.set_view_index(view, group, 0)


    # CREATE PANE
    @max_calls(name='Layout.create')
    def create(self,window):
        rows, cols, cells = self.get_layout(window)
        if rows is None:
            rows, cols, cells = self.get_layout(window)
            if rows is None:
                return


        MAXROWS = len(rows)-1
        MAXCOLS = len(cols)-1

        cols[MAXCOLS] = cols[MAXCOLS-1]+(cols[MAXCOLS]-cols[MAXCOLS-1])*0.65
        cols.append(1.0)
        cells.append([MAXCOLS,0,MAXCOLS+1,MAXROWS])

        layout = {"cols": cols, "rows": rows, "cells": cells}
        self.set_layout(window, layout)


    # DELETE

    @max_calls(name='Layout.delete')