Skip to content

Commit f05c6ca

Browse files
committed
refactor: refonte du CLI et du GUI pour utiliser les nouveaux services et mise à jour des SDK
1 parent 94f6951 commit f05c6ca

33 files changed

Lines changed: 261 additions & 5807 deletions

Core/AdvancedConfigEditor.py

Lines changed: 0 additions & 1194 deletions
This file was deleted.

Core/Globals.py

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
import asyncio
1716
import threading
18-
from PySide6.QtCore import QObject, QTimer, Qt, Signal
19-
20-
21-
class _UiInvoker(QObject):
22-
_sig = Signal(object)
23-
24-
def __init__(self, parent=None):
25-
super().__init__(parent)
26-
self._sig.connect(self._exec, Qt.QueuedConnection)
27-
28-
def post(self, fn):
29-
try:
30-
self._sig.emit(fn)
31-
except Exception:
32-
pass
33-
34-
def _exec(self, fn):
35-
try:
36-
fn()
37-
except Exception:
38-
pass
39-
40-
41-
def _run_coro_async(coro, on_result, ui_owner=None):
42-
invoker = None
43-
try:
44-
if ui_owner is not None and isinstance(ui_owner, QObject):
45-
invoker = getattr(ui_owner, "_ui_invoker", None)
46-
if invoker is None:
47-
invoker = _UiInvoker(ui_owner)
48-
setattr(ui_owner, "_ui_invoker", invoker)
49-
except Exception:
50-
invoker = None
51-
52-
def _runner():
53-
try:
54-
res = asyncio.run(coro)
55-
except Exception as e:
56-
res = e
57-
try:
58-
if invoker is not None:
59-
invoker.post(lambda: on_result(res))
60-
else:
61-
QTimer.singleShot(0, lambda: on_result(res))
62-
except Exception:
63-
pass
64-
65-
threading.Thread(target=_runner, daemon=True).start()
66-
6717

6818
_workspace_dir_lock = threading.RLock()
6919
# Référence globale vers l'instance GUI pour récupération du workspace par l'Plugins_SDK

0 commit comments

Comments
 (0)