import os
from pyqode.core.qt import QT_API
from pyqode.core.qt import PYQT5_API
from pyqode.core.qt import PYQT4_API
from pyqode.core.qt import PYSIDE_API

try:
    if os.environ[QT_API] == PYQT5_API:
        from PyQt5.QtCore import *
        from PyQt5.Qt import Qt
        from PyQt5.QtCore import pyqtSignal as Signal
        from PyQt5.QtCore import pyqtSlot as Slot
        from PyQt5.QtCore import pyqtProperty as Property
        from PyQt5.QtCore import pyqtProperty as Property
        from PyQt5.QtCore import QT_VERSION_STR as __version__
    elif os.environ[QT_API] == PYQT4_API:
        from PyQt4.QtCore import *
        from PyQt4.Qt import Qt
        from PyQt4.QtCore import pyqtSignal as Signal
        from PyQt4.QtCore import pyqtSlot as Slot
        from PyQt4.QtCore import pyqtProperty as Property
        from PyQt4.QtCore import pyqtProperty as Property
        from PyQt4.QtCore import QT_VERSION_STR as __version__
    elif os.environ[QT_API] == PYSIDE_API:
        from PySide.QtCore import *
        import PySide.QtCore
        __version__ = PySide.QtCore.__version__
        from PySide.QtCore import *
except ImportError:
    # allowed when building doc with sphinx (on readthedocs)
    assert os.environ.get('SPHINX', None) == '1'

    class Qt(object):
        blue = None
        red = None

    class QObject(object):
        pass

    class Signal(object):
        def __init__(self, *args):
            pass

    # class Slot(object):
    #     def __init__(self, *args):
    #         pass
    #
    #     def __call__(self, *args, **kwargs):
    #         pass
    import functools

    def Slot(*types, str_name=None, str_result=None):
        def decorator(func):
            @functools.wraps(func)
            def wrapper(*args, **kwds):
                return func(*args, **kwds)
            return wrapper
        return decorator

    # class Signal(object):
    #     def __call__(self, *args, **kwargs): # real signature unknown
    #         pass
    #
    #     def __getitem__(self, *args, **kwargs): # real signature unknown
    #         pass
    #
    #     def __get__(self, *args, **kwargs): # real signature unknown
    #         pass
    #
    #     def __init__(self, *types, name=None): # real signature unknown; restored from __doc__
    #         pass
    #
    #     @staticmethod # known case of __new__
    #     def __new__(*args, **kwargs): # real signature unknown
    #         pass
    #
    #     def __repr__(self, *args, **kwargs): # real signature unknown
    #         pass




    class QThread(object):
        pass

    class QEvent(object):
        @staticmethod
        def Type(foo):
            pass

        @staticmethod
        def registerEventType():
            pass

    def qRegisterResourceData(*args):
        pass

    class QRegExp(object):
        pass

    class Property(object):
        def __init__(self, *args, **kwargs):
            pass

    class QProcess:
        pass
@@ -1450,158 +1450,63 @@
     
-# class Slot(object
+def Slot(*types
 ):%0A    
-#
     
- 
 def 
-__init__(self, *args):%0A    #         pass%0A    #%0A    #     def __call__(self, *args, **kwargs
+decorator(func
 ):%0A   
- #
      
-    pass%0A
     
@@ -1527,91 +1527,8 @@
 ls%0A%0A
-    def Slot(*types, str_name=None, str_result=None):%0A        def decorator(func):%0A
     
@@ -1698,684 +1698,8 @@
 or%0A%0A
-    # class Signal(object):%0A    #     def __call__(self, *args, **kwargs): # real signature unknown%0A    #         pass%0A    #%0A    #     def __getitem__(self, *args, **kwargs): # real signature unknown%0A    #         pass%0A    #%0A    #     def __get__(self, *args, **kwargs): # real signature unknown%0A    #         pass%0A    #%0A    #     def __init__(self, *types, name=None): # real signature unknown; restored from __doc__%0A    #         pass%0A    #%0A    #     @staticmethod # known case of __new__%0A    #     def __new__(*args, **kwargs): # real signature unknown%0A    #         pass%0A    #%0A    #     def __repr__(self, *args, **kwargs): # real signature unknown%0A    #         pass%0A%0A%0A%0A%0A
     

Fix syntax error on rtd where building doc is done with python 2.7