Skip to content

Commit 9bed2ab

Browse files
authored
Merge pull request #3038 from alicevision/dev/add_task_thread_debugging
[dev] Add TaskThread Qt debugging
2 parents 1628f7a + c205bec commit 9bed2ab

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

meshroom/core/attribute.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,11 @@ def getValueStr(self, withQuotes=True) -> str:
358358
# ChoiceParam with multiple values should be combined
359359
if isinstance(self._desc, desc.ChoiceParam) and not self._desc.exclusive:
360360
# Ensure value is a list as expected
361-
assert (isinstance(self.value, Sequence) and not isinstance(self.value, str))
361+
try:
362+
assert (isinstance(self.value, Sequence) and not isinstance(self.value, str))
363+
except AssertionError as e:
364+
logging.error(f"Attribute {self._getFullName()} value contains an error ({self.value}, {type(self.value)})")
365+
raise e
362366
v = self._desc.joinChar.join(self._getEvalValue())
363367
if withQuotes and v:
364368
return f'"{v}"'

meshroom/core/taskManager.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
import os
12
import traceback
23
import logging
34
from threading import Thread
45
from PySide6.QtCore import QThread, QEventLoop, QTimer
56
from enum import Enum
7+
from meshroom.common import strtobool
8+
9+
DEBUGGING = False
10+
if strtobool(os.environ.get("DEBUGGING", "0")):
11+
DEBUGGING = True
12+
import debugpy
613

714
import meshroom
815
from meshroom.common import BaseObject, DictModel, Property, Signal, Slot
@@ -70,6 +77,9 @@ def onChunksCreated(createdNode):
7077

7178
def run(self):
7279
""" Consume compute tasks. """
80+
if DEBUGGING:
81+
debugpy.debug_this_thread()
82+
7383
self._state = State.RUNNING
7484
stopAndRestart = False
7585

0 commit comments

Comments
 (0)