# Path: pdil/vendor/Qt.py
# QT_VERBOSE = bool(os.getenv("QT_VERBOSE"))
# QT_PREFERRED_BINDING = os.getenv("QT_PREFERRED_BINDING", "")
# QT_SIP_API_HINT = os.getenv("QT_SIP_API_HINT")
# def _qInstallMessageHandler(handler):
#     def messageOutputHandler(*args):
# def _getcpppointer(object):
# def _wrapinstance(ptr, base=None):
# def _translate(context, sourceText, *args):
# def _loadUi(uifile, baseinstance=None):
#             def __init__(self, baseinstance):
#             def _loadCustomWidgets(self, etree):
#                 def headerToModule(header):
#             def load(self, uifile, *args, **kwargs):
#             def createWidget(self, class_name, parent=None, name=""):
# def _apply_site_config():
# def _new_module(name):
# def _import_sub_module(module, name):
# def _setup(module, extras):
# def _reassign_misplaced_members(binding):
# def _build_compatibility_members(binding, decorators=None):
# def _pyside2():
# def _pyside():
# def _pyqt5():
# def _pyqt4():
#     def _standardizeQFileDialog(some_function):
#         def wrapper(*args, **kwargs):
# def _none():
# def _log(text):
# def _convert(lines):
#     def parse(line):
# def _cli(args):
# def _install():
#         class _UiLoader(Qt._QtUiTools.QUiLoader):


import contextlib
import importlib
import logging
import os
import sys
import xml.etree.ElementTree as xml
    import pysideuic
        import pyside2uic as pysideuic
from io import StringIO
from maya import OpenMayaUI
from pymel.core import confirmDialog as confirmDialog_orig
from ..vendor.Qt.QtGui import *
from ..vendor.Qt.QtCore import *
from ..vendor.Qt import QtWidgets
    from shiboken import wrapInstance
    from shiboken2 import wrapInstance
    from importlib import reload
from pymel.core import *
    'disableNotify',
]

# Make a top level 'module' so ui files can refer to it directly, aka the generated py code works.
VENDORIMPORT = 'QT_PDIL_vendored'
if VENDORIMPORT not in sys.modules:
    sys.modules[VENDORIMPORT] = sys.modules['pdil.vendor.Qt']


if 'qtCompileLog' not in globals():
    qtCompileLog = logging.getLogger('pdil.qt_compile')
    qtCompileLog.setLevel(logging.WARN)


@contextlib.contextmanager
def singleWindow(name, **kwargs):
    '''
    Ensure just one window of the give `name` exists, and shows it.  Passes kwargs to standard `window()` call.
    '''
    if window(name, exists=True):
        deleteUI(name)
        
    yield window(name, **kwargs)

    showWindow()


def mayaMainWindow():
    try:
        mayaMainWindowPtr = OpenMayaUI.MQtUtil.mainWindow()

# Path: pdil/vendor/Qt.py
# QT_VERBOSE = bool(os.getenv("QT_VERBOSE"))
# QT_PREFERRED_BINDING = os.getenv("QT_PREFERRED_BINDING", "")
# QT_SIP_API_HINT = os.getenv("QT_SIP_API_HINT")
# def _qInstallMessageHandler(handler):
#     def messageOutputHandler(*args):
# def _getcpppointer(object):
# def _wrapinstance(ptr, base=None):
# def _translate(context, sourceText, *args):
# def _loadUi(uifile, baseinstance=None):
#             def __init__(self, baseinstance):
#             def _loadCustomWidgets(self, etree):
#                 def headerToModule(header):
#             def load(self, uifile, *args, **kwargs):
#             def createWidget(self, class_name, parent=None, name=""):
# def _apply_site_config():
# def _new_module(name):
# def _import_sub_module(module, name):
# def _setup(module, extras):
# def _reassign_misplaced_members(binding):
# def _build_compatibility_members(binding, decorators=None):
# def _pyside2():
# def _pyside():
# def _pyqt5():
# def _pyqt4():
#     def _standardizeQFileDialog(some_function):
#         def wrapper(*args, **kwargs):
# def _none():
# def _log(text):
# def _convert(lines):
#     def parse(line):
# def _cli(args):
# def _install():
#         class _UiLoader(Qt._QtUiTools.QUiLoader):


# Path: pdil/_core/ui.py
import contextlib
import importlib
import logging
import os
import sys
import xml.etree.ElementTree as xml
    import pysideuic
        import pyside2uic as pysideuic
from io import StringIO
from maya import OpenMayaUI
from pymel.core import confirmDialog as confirmDialog_orig
from ..vendor.Qt.QtGui import *
from ..vendor.Qt.QtCore import *
from ..vendor.Qt import QtWidgets
    from shiboken import wrapInstance
    from shiboken2 import wrapInstance
    from importlib import reload
from pymel.core import *

    'disableNotify',
]

# Make a top level 'module' so ui files can refer to it directly, aka the generated py code works.
VENDORIMPORT = 'QT_PDIL_vendored'
if VENDORIMPORT not in sys.modules:
    sys.modules[VENDORIMPORT] = sys.modules['pdil.vendor.Qt']


if 'qtCompileLog' not in globals():
    qtCompileLog = logging.getLogger('pdil.qt_compile')
    qtCompileLog.setLevel(logging.WARN)


@contextlib.contextmanager
def singleWindow(name, **kwargs):
    '''
    Ensure just one window of the give `name` exists, and shows it.  Passes kwargs to standard `window()` call.
    '''
    if window(name, exists=True):
        deleteUI(name)
        
    yield window(name, **kwargs)

    showWindow()


def mayaMainWindow():
    try:
        mayaMainWindowPtr = OpenMayaUI.MQtUtil.mainWindow()

        window = wrapInstance(long(mayaMainWindowPtr), QtWidgets.QWidget)