# 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 base64
import zlib
from ..vendor.Qt import QtGui
    except TypeError: # python 3 compatibility, most sources will probably be strings
        code = zlib.compress(data.encode(), level)
        
    code = base64.encodestring(code)
    return code


def asciiDecompress(code):
    '''
    Decompress result of asciiCompress
    From http://code.activestate.com/recipes/355486-compress-data-to-printable-ascii-data/
    '''
    try:
        code = base64.decodestring(code)
    except TypeError: # python 3 compatibility, most sources will probably be strings
        code = base64.decodestring(code.encode())
        
    data = zlib.decompress(code)
    return data


class clipboard(object):
    '''
    Originally only the windows clipboard was supported from help of
    From http://stackoverflow.com/questions/579687/how-do-i-copy-a-string-to-the-clipboard-on-windows-using-python
    but that stopped working in 2016 (maybe earlier) so just use Qt for compatibility, and since it works.
    '''
    
    @classmethod
    def get(cls):

# 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/text.py
import base64
import zlib
from ..vendor.Qt import QtGui

    except TypeError: # python 3 compatibility, most sources will probably be strings
        code = zlib.compress(data.encode(), level)
        
    code = base64.encodestring(code)
    return code


def asciiDecompress(code):
    '''
    Decompress result of asciiCompress
    From http://code.activestate.com/recipes/355486-compress-data-to-printable-ascii-data/
    '''
    try:
        code = base64.decodestring(code)
    except TypeError: # python 3 compatibility, most sources will probably be strings
        code = base64.decodestring(code.encode())
        
    data = zlib.decompress(code)
    return data


class clipboard(object):
    '''
    Originally only the windows clipboard was supported from help of
    From http://stackoverflow.com/questions/579687/how-do-i-copy-a-string-to-the-clipboard-on-windows-using-python
    but that stopped working in 2016 (maybe earlier) so just use Qt for compatibility, and since it works.
    '''
    
    @classmethod
    def get(cls):

        return QtGui.QClipboard().text()