# Path: mGui/gui.py
# def _collect_mappings():
# def wrap(control, replace_events=False):
# def derive(control):
# 
# Path: mGui/forms.py
# def physical_controls(widget):
#     def __init__(self, key=None, **kwargs):
#     def _fill(self, ctrl, *sides, **kwargs):
#     def top(self, ctrl, margin=None):
#     def left(self, ctrl, margin=None):
#     def right(self, ctrl, margin=None):
#     def bottom(self, ctrl, margin=None):
#     def fill(self, ctrl, margin=None):
#     def snap(self, ctrl1, ctrl2, edge, space=None):
#     def form_attachments(self, *sides):
#     def form_series(self, side):
#     def percentage_series(self, side):
#     def equal_series(self, side):
#     def dock(self, ctrl, top=None, left=None, right=None, bottom=None):
#     def detach(self, *controls):
#     def __init__(self, key=None):
#     def __enter__(self):
#     def __exit__(self, typ, value, tb):
#     def fake_create(*args, **kwargs):
#     def forget(self, *args, **kwargs):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
# class Form(FormLayout):
# class LayoutDialogForm(Form):
# class FillForm(Form):
# class VerticalForm(Form):
# class HorizontalForm(Form):
# class VerticalExpandForm(Form):
# class HorizontalExpandForm(Form):
# class HorizontalStretchForm(Form):
# class VerticalStretchForm(Form):
# class VerticalThreePane(Form):
# class HorizontalThreePane(Form):
# class FooterForm(VerticalForm):
# class HeaderForm(VerticalForm):
# class NavForm(HorizontalForm):
# 
# Path: mGui/events.py
# class Event(object):
# class MayaEvent(Event):
# class DeadReferenceError(TypeError):
# class WeakMethodBound(object):
# class WeakMethodFree(object):
#     def __init__(self, **data):
#     def _add_handler(self, handler):
#     def _remove_handler(self, handler):
#     def metadata(self, kwargs):
#     def _fire(self, *args, **kwargs):
#     def _handler_count(self):
#     def __del__(self):
#     def _fire(self, *args, **kwargs):
#     def __init__(self, f):
#     def __call__(self, *args, **kwargs):
#     def __eq__(self, other):
#     def __hash__(self):
#     def __init__(self, f):
#     def __call__(self, *args, **kwargs):
#     def __eq__(self, other):
#     def __hash__(self):
# def get_weak_reference(f):
# def event_handler(fn):
#     def wrapper(*_, **__):


from unittest import TestCase, main
from maya import cmds, standalone
from mGui import gui, forms, events
    return 'window1|formLayout1'

def _button(*args, **kwargs):
    if 'exists' in kwargs:
        return True
    return 'window1|formLayout1|button1'

def _control(*args, **kwargs):
    if 'exists' in kwargs:
        return True


cmds.control = cmds.layout = _control
cmds.window = _window
cmds.formLayout = _formLayout
cmds.button = _button
cmds.setParent = lambda *args, **kwargs: None

# Mocking this with an empty event because cmds.scriptJob is annoyingly complex
gui.Control.onDeleted = events.MayaEvent()


class TestNesting(TestCase):

    def setUp(self):
        with gui.Window() as win:
            with forms.VerticalForm() as vf:
                btn = gui.Button()
                btn2 = gui.Button()
                for i in xrange(3):

# Path: mGui/gui.py
# def _collect_mappings():
# def wrap(control, replace_events=False):
# def derive(control):
# 
# Path: mGui/forms.py
# def physical_controls(widget):
#     def __init__(self, key=None, **kwargs):
#     def _fill(self, ctrl, *sides, **kwargs):
#     def top(self, ctrl, margin=None):
#     def left(self, ctrl, margin=None):
#     def right(self, ctrl, margin=None):
#     def bottom(self, ctrl, margin=None):
#     def fill(self, ctrl, margin=None):
#     def snap(self, ctrl1, ctrl2, edge, space=None):
#     def form_attachments(self, *sides):
#     def form_series(self, side):
#     def percentage_series(self, side):
#     def equal_series(self, side):
#     def dock(self, ctrl, top=None, left=None, right=None, bottom=None):
#     def detach(self, *controls):
#     def __init__(self, key=None):
#     def __enter__(self):
#     def __exit__(self, typ, value, tb):
#     def fake_create(*args, **kwargs):
#     def forget(self, *args, **kwargs):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
#     def layout(self):
# class Form(FormLayout):
# class LayoutDialogForm(Form):
# class FillForm(Form):
# class VerticalForm(Form):
# class HorizontalForm(Form):
# class VerticalExpandForm(Form):
# class HorizontalExpandForm(Form):
# class HorizontalStretchForm(Form):
# class VerticalStretchForm(Form):
# class VerticalThreePane(Form):
# class HorizontalThreePane(Form):
# class FooterForm(VerticalForm):
# class HeaderForm(VerticalForm):
# class NavForm(HorizontalForm):
# 
# Path: mGui/events.py
# class Event(object):
# class MayaEvent(Event):
# class DeadReferenceError(TypeError):
# class WeakMethodBound(object):
# class WeakMethodFree(object):
#     def __init__(self, **data):
#     def _add_handler(self, handler):
#     def _remove_handler(self, handler):
#     def metadata(self, kwargs):
#     def _fire(self, *args, **kwargs):
#     def _handler_count(self):
#     def __del__(self):
#     def _fire(self, *args, **kwargs):
#     def __init__(self, f):
#     def __call__(self, *args, **kwargs):
#     def __eq__(self, other):
#     def __hash__(self):
#     def __init__(self, f):
#     def __call__(self, *args, **kwargs):
#     def __eq__(self, other):
#     def __hash__(self):
# def get_weak_reference(f):
# def event_handler(fn):
#     def wrapper(*_, **__):


# Path: tests/test_nested.py
from unittest import TestCase, main
from maya import cmds, standalone
from mGui import gui, forms, events

    return 'window1|formLayout1'

def _button(*args, **kwargs):
    if 'exists' in kwargs:
        return True
    return 'window1|formLayout1|button1'

def _control(*args, **kwargs):
    if 'exists' in kwargs:
        return True


cmds.control = cmds.layout = _control
cmds.window = _window
cmds.formLayout = _formLayout
cmds.button = _button
cmds.setParent = lambda *args, **kwargs: None

# Mocking this with an empty event because cmds.scriptJob is annoyingly complex
gui.Control.onDeleted = events.MayaEvent()


class TestNesting(TestCase):

    def setUp(self):
        with gui.Window() as win:
            with forms.VerticalForm() as vf:
                btn = gui.Button()
                btn2 = gui.Button()
                for i in xrange(3):

                    gui.Button()