ManyQt 0.3.2__py2-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. ManyQt/QAxContainer.py +54 -0
  2. ManyQt/Qsci.py +29 -0
  3. ManyQt/Qt3DAnimation.py +48 -0
  4. ManyQt/Qt3DCore.py +48 -0
  5. ManyQt/Qt3DExtras.py +48 -0
  6. ManyQt/Qt3DInput.py +48 -0
  7. ManyQt/Qt3DLogic.py +48 -0
  8. ManyQt/Qt3DRender.py +48 -0
  9. ManyQt/QtAsyncio.py +43 -0
  10. ManyQt/QtAxContainer.py +54 -0
  11. ManyQt/QtBluetooth.py +32 -0
  12. ManyQt/QtChart.py +46 -0
  13. ManyQt/QtCharts.py +47 -0
  14. ManyQt/QtConcurrent.py +141 -0
  15. ManyQt/QtCore.py +1286 -0
  16. ManyQt/QtDBus.py +33 -0
  17. ManyQt/QtDataVisualization.py +44 -0
  18. ManyQt/QtDesigner.py +34 -0
  19. ManyQt/QtGraphs.py +38 -0
  20. ManyQt/QtGraphsWidgets.py +33 -0
  21. ManyQt/QtGui.py +533 -0
  22. ManyQt/QtHelp.py +33 -0
  23. ManyQt/QtHttpServer.py +34 -0
  24. ManyQt/QtLocation.py +32 -0
  25. ManyQt/QtMacExtras.py +35 -0
  26. ManyQt/QtMultimedia.py +36 -0
  27. ManyQt/QtMultimediaWidgets.py +33 -0
  28. ManyQt/QtNetwork.py +79 -0
  29. ManyQt/QtNetworkAuth.py +38 -0
  30. ManyQt/QtNfc.py +32 -0
  31. ManyQt/QtOpenGL.py +33 -0
  32. ManyQt/QtOpenGLWidgets.py +27 -0
  33. ManyQt/QtPdf.py +29 -0
  34. ManyQt/QtPdfWidgets.py +28 -0
  35. ManyQt/QtPositioning.py +32 -0
  36. ManyQt/QtPrintSupport.py +60 -0
  37. ManyQt/QtPurchasing.py +32 -0
  38. ManyQt/QtQml.py +27 -0
  39. ManyQt/QtQuick.py +29 -0
  40. ManyQt/QtQuick3D.py +32 -0
  41. ManyQt/QtQuickControls2.py +23 -0
  42. ManyQt/QtQuickWidgets.py +27 -0
  43. ManyQt/QtRemoteObjects.py +32 -0
  44. ManyQt/QtScxml.py +26 -0
  45. ManyQt/QtSensors.py +32 -0
  46. ManyQt/QtSerialBus.py +33 -0
  47. ManyQt/QtSerialPort.py +32 -0
  48. ManyQt/QtSpatialAudio.py +32 -0
  49. ManyQt/QtSql.py +33 -0
  50. ManyQt/QtStateMachine.py +26 -0
  51. ManyQt/QtSvg.py +34 -0
  52. ManyQt/QtSvgWidgets.py +33 -0
  53. ManyQt/QtTest.py +283 -0
  54. ManyQt/QtTextToSpeech.py +32 -0
  55. ManyQt/QtUiTools.py +25 -0
  56. ManyQt/QtVirtualKeyboard.py +40 -0
  57. ManyQt/QtWebChannel.py +31 -0
  58. ManyQt/QtWebEngineCore.py +55 -0
  59. ManyQt/QtWebEngineQuick.py +29 -0
  60. ManyQt/QtWebEngineWidgets.py +45 -0
  61. ManyQt/QtWebKit.py +77 -0
  62. ManyQt/QtWebKitWidgets.py +34 -0
  63. ManyQt/QtWebSockets.py +32 -0
  64. ManyQt/QtWebView.py +98 -0
  65. ManyQt/QtWidgets.py +1019 -0
  66. ManyQt/QtWinExtras.py +25 -0
  67. ManyQt/QtX11Extras.py +35 -0
  68. ManyQt/QtXml.py +33 -0
  69. ManyQt/QtXmlPatterns.py +33 -0
  70. ManyQt/__init__.py +89 -0
  71. ManyQt/__main__.py +27 -0
  72. ManyQt/_api.py +202 -0
  73. ManyQt/_backport/QtCore.py +301 -0
  74. ManyQt/_backport/QtDBus.py +22 -0
  75. ManyQt/_backport/QtDesigner.py +5 -0
  76. ManyQt/_backport/QtGui.py +1127 -0
  77. ManyQt/_backport/QtHelp.py +17 -0
  78. ManyQt/_backport/QtMultimedia.py +15 -0
  79. ManyQt/_backport/QtNetwork.py +49 -0
  80. ManyQt/_backport/QtOpenGL.py +7 -0
  81. ManyQt/_backport/QtSql.py +21 -0
  82. ManyQt/_backport/QtSvg.py +22 -0
  83. ManyQt/_backport/QtTest.py +5 -0
  84. ManyQt/_backport/QtWebKit.py +19 -0
  85. ManyQt/_backport/QtXml.py +37 -0
  86. ManyQt/_backport/QtXmlPatterns.py +22 -0
  87. ManyQt/_backport/__init__.py +4 -0
  88. ManyQt/_backport/_utils.py +31 -0
  89. ManyQt/_backport/uic.py +5 -0
  90. ManyQt/_compat.py +258 -0
  91. ManyQt/_ctypes.py +110 -0
  92. ManyQt/_fixes.py +784 -0
  93. ManyQt/cli.py +176 -0
  94. ManyQt/importhooks.py +162 -0
  95. ManyQt/shiboken.py +131 -0
  96. ManyQt/sip.py +131 -0
  97. ManyQt/uic.py +75 -0
  98. ManyQt-0.3.2.dist-info/LICENSE.txt +674 -0
  99. ManyQt-0.3.2.dist-info/METADATA +123 -0
  100. ManyQt-0.3.2.dist-info/RECORD +102 -0
  101. ManyQt-0.3.2.dist-info/WHEEL +5 -0
  102. ManyQt-0.3.2.dist-info/top_level.txt +1 -0
ManyQt/QtConcurrent.py ADDED
@@ -0,0 +1,141 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Provides QtConcurrent classes and functions.
4
+ """
5
+ from os.path import dirname
6
+ from sys import path
7
+
8
+ if dirname(__file__) not in path:
9
+ path.append(dirname(__file__))
10
+
11
+ try:
12
+ from ._api import USED_API, QT_API_PYSIDE, QT_API_PYSIDE2, QT_API_PYSIDE6, apply_global_fixes
13
+ except:
14
+ from _api import USED_API, QT_API_PYSIDE, QT_API_PYSIDE2, QT_API_PYSIDE6, apply_global_fixes
15
+
16
+ try:
17
+ if USED_API == QT_API_PYSIDE:
18
+ try:
19
+ from PySide.QtConcurrent import *
20
+ except:
21
+ from PySide.QConcurrent import *
22
+ elif USED_API == QT_API_PYSIDE2:
23
+ from PySide2.QtConcurrent import *
24
+ elif USED_API == QT_API_PYSIDE6:
25
+ from PySide6.QtConcurrent import *
26
+ except:
27
+ from traceback import format_exc
28
+
29
+ try:
30
+ from .QtCore import QObject, pyqtSignal, QThread, pyqtSlot
31
+ except:
32
+ from QtCore import QObject, pyqtSignal, QThread, pyqtSlot
33
+
34
+
35
+ class WorkerThread(QThread):
36
+ """
37
+ WorkerThread runs a target function in a background thread.
38
+ """
39
+ finished = pyqtSignal(object) # type: pyqtSignal # Emitted with result.
40
+ failed = pyqtSignal(Exception, 'QString') # type: pyqtSignal # Emitted with exception and traceback.
41
+
42
+ def __init__(self, fn, *args, **kwargs):
43
+ """
44
+ :param fn: Callable.
45
+ :param args: (any) Arguments for callable.
46
+ :param kwargs: (any) Keyword arguments for callable.
47
+ """
48
+ super(WorkerThread, self).__init__()
49
+ self._fn = fn
50
+ self._args = args
51
+ self._kwargs = kwargs
52
+ self._cancelled = False # type: bool
53
+
54
+ @pyqtSlot()
55
+ def run(self):
56
+ """
57
+ :return: None
58
+ """
59
+ try:
60
+ if self._cancelled:
61
+ return
62
+ result = self._fn(*self._args, **self._kwargs)
63
+ if not self._cancelled:
64
+ self.finished.emit(result)
65
+ except Exception as e:
66
+ self.failed.emit(e, format_exc())
67
+
68
+ @pyqtSlot()
69
+ def cancel(self):
70
+ """
71
+ :return:
72
+ """
73
+ self._cancelled = True # type: bool
74
+
75
+
76
+ class QtConcurrent(QObject):
77
+ """
78
+ A class that mimics QtConcurrent behavior using QThread.
79
+ """
80
+
81
+ finished = pyqtSignal(object) # type: pyqtSignal # Emits result when done.
82
+ failed = pyqtSignal(Exception, str) # type: pyqtSignal # Emits error with traceback.
83
+ started = pyqtSignal() # type: pyqtSignal # Emits when thread starts.
84
+ canceled = pyqtSignal() # type: pyqtSignal # Emits when task is cancelled.
85
+
86
+ def __init__(self, *args, **kwargs):
87
+ """
88
+ :param args: any
89
+ :param kwargs: any
90
+ """
91
+ super(QtConcurrent, self).__init__(*args, **kwargs)
92
+ self._thread = None # type: WorkerThread | None
93
+
94
+ def run(self, fn, *args, **kwargs):
95
+ """
96
+ Run a function in a background thread.
97
+ :param fn: Function to run.
98
+ :param args: Positional arguments.
99
+ :param kwargs: Keyword arguments.
100
+ :return:
101
+ """
102
+ self.cancel() # Cancel existing if any
103
+ self._thread = WorkerThread(fn, *args, **kwargs) # type: WorkerThread
104
+ self._thread.finished.connect(self._onFinished)
105
+ self._thread.failed.connect(self._onFailed)
106
+ self.started.emit()
107
+ self._thread.start()
108
+
109
+ @pyqtSlot(object)
110
+ def _onFinished(self, result):
111
+ """
112
+ :param result: object
113
+ :return:
114
+ """
115
+ self.finished.emit(result)
116
+ self._cleanup()
117
+
118
+ @pyqtSlot(Exception, str)
119
+ def _onFailed(self, exc, tb):
120
+ self.failed.emit(exc, tb)
121
+ self._cleanup()
122
+
123
+ @pyqtSlot()
124
+ def cancel(self):
125
+ """
126
+ :return:
127
+ """
128
+ if self._thread is not None and self._thread.isRunning():
129
+ self._thread.cancel()
130
+ self._thread.quit()
131
+ self._thread.wait()
132
+ self.canceled.emit()
133
+ self._cleanup()
134
+
135
+ def _cleanup(self):
136
+ """
137
+ :return:
138
+ """
139
+ self._thread = None # type: WorkerThread | None
140
+
141
+ apply_global_fixes(globals())